Advertisement
Dark_Agent

FE Give hat [R15, R6]

Feb 12th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. --[[
  2. Give hats to people (R15, R6)
  3.  
  4. Works well on R6, R15 games are impossible to detect the point of height so expect inaccuracy of hats given to a certain player
  5.  
  6. Reset when script breaks or you need to restart to receive your hats back
  7.  
  8. Made By Fedoratum()()
  9. --]]
  10.  
  11. -- This will say stuff like admin do
  12.  
  13. local fakeadmin = false
  14. -- set to true or false
  15.  
  16. -- givehats hatname fedoratum
  17.  
  18. function mOut(txt, type)
  19. if type == 1 then
  20. spawn(function()
  21. local m = Instance.new("Message", game.CoreGui)
  22. m.Text = txt
  23. task.wait(3)
  24. m:Destroy()
  25. end)
  26. elseif type == 2 then
  27. spawn(function()
  28. local h = Instance.new("Hint", game.CoreGui)
  29. h.Text = txt
  30. task.wait(3)
  31. h:Destroy()
  32. end)
  33. end
  34. end
  35.  
  36.  
  37. local ScreenGui = Instance.new("ScreenGui")
  38. local Main = Instance.new("Frame")
  39. local Punish = Instance.new("TextBox")
  40. local SilentCMD = Instance.new("TextBox")
  41. local SilentC = Instance.new("TextButton")
  42. local X = Instance.new("TextButton")
  43. local plr = game:GetService"Players".LocalPlayer
  44.  
  45. ScreenGui.Parent = game.CoreGui
  46. ScreenGui.ResetOnSpawn = false
  47.  
  48. Main.Name = "Main"
  49. Main.Parent = ScreenGui
  50. Main.BackgroundColor3 = Color3.new(0.333333, 0.666667, 0.498039)
  51. Main.BorderSizePixel = 4
  52. Main.Position = UDim2.new(0.117575757, 0, 0.152334154, 0)
  53. Main.Size = UDim2.new(0, 334, 0, 120)
  54. Main.Active = true
  55. Main.Draggable = true
  56.  
  57. Punish.Name = "Punish"
  58. Punish.Parent = Main
  59. Punish.BackgroundColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  60. Punish.BorderColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  61. Punish.Position = UDim2.new(0.0209580846, 0, 0.094202876, 0)
  62. Punish.Size = UDim2.new(0, 162, 0, 50)
  63. Punish.Font = Enum.Font.GothamBlack
  64. Punish.PlaceholderText = "Player Name"
  65. Punish.Text = ""
  66. Punish.TextColor3 = Color3.new(1, 1, 1)
  67. Punish.TextSize = 14
  68. Punish.TextStrokeColor3 = Color3.new(1, 1, 1)
  69.  
  70. SilentCMD.Name = "SilentCMD"
  71. SilentCMD.Parent = Main
  72. SilentCMD.BackgroundColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  73. SilentCMD.BorderColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  74. SilentCMD.Position = UDim2.new(0.514970064, 0, 0.094202876, 0)
  75. SilentCMD.Size = UDim2.new(0, 152, 0, 50)
  76. SilentCMD.Font = Enum.Font.GothamBlack
  77. SilentCMD.PlaceholderText = "Hat Name"
  78. SilentCMD.Text = ""
  79. SilentCMD.TextColor3 = Color3.new(1, 1, 1)
  80. SilentCMD.TextSize = 14
  81. SilentCMD.TextStrokeColor3 = Color3.new(1, 1, 1)
  82.  
  83. SilentC.Name = "SilentC"
  84. SilentC.Parent = Main
  85. SilentC.BackgroundColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  86. SilentC.BorderColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  87. SilentC.Position = UDim2.new(0.280070064, 0, 0.554202876, 0)
  88. SilentC.Size = UDim2.new(0, 152, 0, 50)
  89. SilentC.Font = Enum.Font.GothamBlack
  90. SilentC.Text = "Hat him/her"
  91. SilentC.TextColor3 = Color3.new(1, 1, 1)
  92. SilentC.TextSize = 14
  93. SilentC.TextStrokeColor3 = Color3.new(1, 1, 1)
  94.  
  95. X.Name = "X"
  96. X.Parent = Main
  97. X.BackgroundColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  98. X.BorderColor3 = Color3.new(0.168627, 0.513726, 0.25098)
  99. X.BorderSizePixel = 0
  100. X.Position = UDim2.new(0.952095807, 0, 0, 0)
  101. X.Size = UDim2.new(0, 16, 0, 16)
  102. X.Font = Enum.Font.SourceSans
  103. X.Text = "X"
  104. X.TextColor3 = Color3.new(1, 1, 1)
  105. X.TextScaled = true
  106. X.TextSize = 14
  107. X.TextWrapped = true
  108.  
  109. function getPlayer(shortcut)
  110. local player = nil
  111. local g = game.Players:GetPlayers()
  112. for i = 1, #g do
  113. if string.lower(string.sub(g[i].Name,1,string.len(shortcut))) == string.lower(shortcut) then
  114. if g[i] ~= nil then
  115. player = g[i]
  116. break
  117. end
  118. end
  119. end
  120. return player
  121. end
  122.  
  123. function getHat(shortcuts)
  124. local hat = nil
  125. for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  126. if v:IsA("Accessory") then
  127. if string.lower(string.sub(v.Name,1,string.len(shortcuts))) == string.lower(shortcuts) then
  128. if v.Name ~= nil then
  129. hat = v
  130. break
  131. end
  132. end
  133. end
  134. end
  135. return hat
  136. end
  137.  
  138. local runcode = true
  139. local spawntime = game.Players.RespawnTime + 3
  140.  
  141. local hatstored = {}
  142.  
  143. SilentC.MouseButton1Click:Connect(function()
  144. local char = plr.Character
  145. if runcode then
  146. runcode = false
  147.  
  148. local dfc = game.ReplicatedStorage.DefaultChatSystemChatEvents
  149. local smr = dfc.SayMessageRequest
  150.  
  151. local hatse = getHat(SilentCMD.Text)
  152. local arg = getPlayer(Punish.Text)
  153.  
  154. if table.find(hatstored, hatse.Name) then
  155. mOut("Hat is already given away, error", 1)
  156. return end
  157.  
  158. argplr = game.Players[arg.Name].Character
  159.  
  160. local rs = game:GetService("RunService")
  161. local fc
  162. local dc
  163. local dic
  164. local coc
  165. char.Archivable = true
  166. headname = char.Head.Name
  167. local cchar = char:Clone()
  168. cchar.Parent = Workspace
  169.  
  170. local con
  171. con = char.Humanoid.Died:Connect(function()
  172. cchar:Destroy()
  173. Main.Visible = false
  174. runcode = false
  175. mOut("Wait For "..tostring(spawntime).." Second", 1)
  176. table.clear(hatstored)
  177. task.wait(spawntime)
  178. Main.Visible = true
  179. runcode = true
  180. con:Disconnect()
  181. end)
  182.  
  183. if fakeadmin then
  184. smr:FireServer(";givehat "..hatse.Name.." "..arg.Name, "All")
  185. end
  186.  
  187. cchar.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame
  188. for i, x in pairs(cchar:GetDescendants()) do
  189. if x:IsA("BasePart") then
  190. x.Transparency = 1
  191. end
  192. end
  193. for i, v in pairs(cchar.Head:GetDescendants()) do
  194. if v.className == "Decal" or v.className == "Texture" then
  195. v.Transparency = 1
  196. end
  197. end
  198.  
  199. for i,v in pairs(char:GetDescendants()) do
  200. if v:IsA("BasePart") and v.Name ~="HumanoidRootPart" then
  201. fc = rs.Heartbeat:Connect(function()
  202. if char.Humanoid.Health <= 0 then fc:Disconnect() return end
  203. v.Velocity = Vector3.new(30, 4, 0)
  204. v.RotVelocity = Vector3.new(30, 4, 0)
  205. end)
  206. end
  207. end
  208.  
  209. dic = rs.RenderStepped:Connect(function()
  210. setscriptable(plr, "SimulationRadius", true)
  211. plr.SimulationRadius = math.huge * math.huge, math.huge * math.huge * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0 * 1 / 0
  212. end)
  213.  
  214. coc = plr.SimulationRadiusChanged:Connect(function(radius)
  215. radius = math.huge
  216. return radius
  217. end)
  218.  
  219. char[hatse.Name].Handle.AccessoryWeld:Destroy()
  220.  
  221. dc = rs.RenderStepped:Connect(function()
  222. if char.Humanoid.Health <= 0 then dc:Disconnect() cchar:Destroy() coc:Disconnect() dic:Disconnect() return end
  223. cchar.HumanoidRootPart.CFrame = argplr.HumanoidRootPart.CFrame
  224. char[hatse.Name].Handle.CFrame = cchar[hatse.Name].Handle.CFrame
  225. end)
  226. table.insert(hatstored, hatse.Name)
  227. end
  228. runcode = true
  229. end)
  230.  
  231. X.MouseButton1Click:Connect(function()
  232. ScreenGui:Destroy()
  233. end)
  234.  
  235. mOut("Fedoratum Hat Giver Has Loaded", 2)
  236.  
  237. print("What accessories you have on")
  238. for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  239. if v:IsA("Accessory") then
  240. print("What accessories you have on")
  241. print(v.Name)
  242. end
  243. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement