I did make this script but as i tryed testing it it didnt gave me the hat what did i do wrong?
This Script Schould give the Creator an hat
if Creators("LordDamionDevil","Juide") then local hat = 180516502 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) asset = game:GetService("InsertService"):LoadAsset(hat) give = game:GetService("InsertService"):Insert(asset) local children = asset:GetChildren() for i = 1, #children do children[i].Parent = character end end) end)
You're missing a couple things. First, there is no 'end' for your if statement in the first line of code. Second, 'Creators' does not appear to be a function, and the if statement is unnecessary anyway.
local Creators = {"LordDamionDevil","Juide"} -- This is a table which will help us later on in the script. local hat = 180516502 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) for i,v in pairs(Creators) do -- This is a convenient method of going through the list of Creators to see if the player's name is in there. if v == player.Name then asset = game:GetService("InsertService"):LoadAsset(hat) give = game:GetService("InsertService"):Insert(asset) local children = asset:GetChildren() for i,v in pairs(children) do if v:IsA("Hat") then v.Parent = player end end end end) end)