How could it work in studio but not online? [EDIT] What i am trying to accomplish already works, but only in roblox studio test mode, and not when i publish it to roblox! here is my script
wait(2) repeat wait(1) if workspace:findFirstChild(script.Parent.Parent.Parent.Parent.Name) then if script.Parent.Value == 1 and script.Parent.Parent.CamValue.Value == 1 then Workspace.Player.Torso.CFrame = CFrame.new(Workspace.Spawners.WhiteSpawn.Position + Vector3.new(0, 2, 0)) elseif script.Parent.Value == 2 and script.Parent.Parent.CamValue.Value == 1 then Workspace.Player.Torso.CFrame = CFrame.new(Workspace.Spawners.GraySpawn.Position + Vector3.new(0, 2, 0)) elseif script.Parent.Value == 3 and script.Parent.Parent.CamValue.Value == 1 then Workspace.Player.Torso.CFrame = CFrame.new(Workspace.Spawners.BlackSpawn.Position + Vector3.new(0, 2, 0)) end end until script.Parent.Parent.CamValue.Value == 0
Please help!!! Thank you!!! P.S this is in starterGui so it will spawn whenever the character (re)spawns P.P.S this is in a localscript
If things are inserted during the game, as it seems, use
WaitForChild()
instead of FindFirstChild()
In studio, test mode is more lenient, meaning that Server and local scripts are technically the same. However in online mode, server and local scripts run on the server and on the client respectively. Also FilteringEnabled is activated here. Check your code is FilteringEnabled-safe and don't try to do server stuff in local scripts and don't try to do local stuff in server scripts.
RemoteFunctions and RemoteEvents are your best friends. Don't mix server and local up.
If you follow the above, you should be fine.
Hope this helps!
-DuckWick -Headmaster of Creative Developers