Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't my hat spawn on my head when I respawn/reset? It works when I join the game.

Asked by 7 years ago

game.Players.PlayerAdded:connect(function(player) repeat wait()until player.Character local hatId=1045408 if player.Name=="ROBLOX"then hatId=21070012 end local hat = game:service("InsertService"):LoadAsset(hatId):GetChildren()[1] hat.Parent=player.Character end) a=Instance.new("IntValue", game.Workspace) repeat wait() a.Value=a.Value+1 until a.Value==100

repeat wait() print("checking") until game.Players.NumPlayers==1

0
Your code isn't set to fire again when you reset; I recommend using the 'CharacterAdded' event to accomplish this. :) TheeDeathCaster 2368 — 7y
0
(I'm bad at scripting) I tried adding this code in the second and third line but it won't work: player.CharacterAdded:connect(function(character) character.Humanoid.hatId=1045408 WARSwarswars 0 — 7y
0
Can you do me a quick favor and format the code real quick. I think I see the issue and some things you should fix NewVoids 97 — 7y

Answer this question