Advertisement
Xnaate

FE Hat Giver Script (R6/R15)

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