I’m trying to clone “Alive” to the player’s character. Right now, it doesn’t do that. Alive is a sibling of the script, and the parent BoolValue’s value is true.
local plrs = game:GetService('Players')
plrs.PlayerAdded:Connect(function(plr)
if script.Parent.Value == true then
wait(plr.Character)
script.Parent.Alive:Clone().Parent = plr.Character
else
plr:Kick('The round has already started, joining is now disabled.')
end
end)
didn’t wait for the players character to load, since the player loads before the character.
^ you did wait, but i dont think it actually waited
local plrs = game:GetService('Players')
plrs.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if script.Parent.Value == true then
script.Parent.Alive:Clone().Parent = char
else
plr:Kick('The round has already started, joining is now disabled.')
end
end)
end)
^bad formatting due to writing in on devfourms sorry, working on it
wait(plr.Character) isn’t correct. You can do the following:
local plrs = game:GetService('Players')
plrs.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
if script.Parent.Value == true then
script.Parent.Alive:Clone().Parent = char
else
plr:Kick('The round has already started, joining is now disabled.')
end
end)