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

Script only activating on game entry, not on every spawn?

Asked by 4 years ago

Heyo guys, I posted this in the discord but uh I really just need help figuring out what and where to edit this (as in the specific text to enter and what line it needs to go in). It seems like I'm really just messing up on something very simple

--why
local groupId =946493
function RegisterPlayer( player ) 
if CheckInGroup(player, groupId) then 
HoldThreadForCharacter(player) 
player.Character:MoveTo(script.Parent.Position + Vector3.new(0,3,0)) 
end 
end 
--wont
function CheckInGroup( player, id ) 
if player:IsInGroup(id) then 
return true 
end 
return false 
end 
--you
function HoldThreadForCharacter( player ) 
repeat wait() until Workspace:FindFirstChild(player.Name) 
end 
--work!!!!
Game.Players.PlayerAdded:connect(RegisterPlayer) 
for i,v in pairs(Game.Players:GetPlayers()) do 
RegisterPlayer(v) 
end 

0
please format your code. ScuffedAI 435 — 4y
0
Format how? WHOMATEY98765 0 — 4y
0
i think he means indent your code properly fanofpixels 718 — 4y

Answer this question