FIRST SCRIPT THAT GIVES THE PLAYER THE SCRIPT
function Joined(Player) plr = game.Workspace:WaitForChild(Player.Name) wait(3) a = script.Script:clone() a.Parent = plr a.Disabled = false end game.Players.PlayerAdded:connect(Joined)
SECOND SCRIPT CHECKS IF VALUE IS TRUE IF IT ISNT THEN PUTS A STRINGVALUE INTO THE PLAYER
NOTE THERE IS A PROBLEM THAT TWO COPIES ARE GOING INTO ONE PLAYER AND THE SECOND PLAYER GETS NONE!
while true do wait() if game.Workspace.Room1.Value == false then game.Workspace.Room1.Value = true ro = Instance.new("StringValue") ro.Value = "RoomA" ro.Name = "Room" ro.Parent = game.Players.LocalPlayer.Character wait(5) script.Disabled = true script:Destroy() end if game.Workspace.Room2.Value == false then game.Workspace.Room2.Value = true ro = Instance.new("StringValue") ro.Value = "RoomB" ro.Name = "Room" ro.Parent = game.Players.LocalPlayer.Character script.Parent.Script:Destroy() wait(1) end end
Please help it will mean alot!! You will be mentioned in my game if you help me!
This is the best I can interpret your problem. I used the Character property of Player instead of searching through workspace. I also used an anonymous function to shorten the code slightly. It will also check for the Character every half second and proceed only when it's found.
game.Players.PlayerAdded:connect(function(plr) repeat wait(.5) until plr.Character a = script.Script:clone() a.Parent = plr.Character a.Disabled = false end)