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

How to fix code that works in Roblox Studio but not in the Client?

Asked by 8 years ago

Here is my code it turns on one of my teleporters, when I run it in studio everything works fine but when I play it via roblox.com > Develop > My Game my script doesent work its a LocalScript in StarterPlayerScripts its not disabled if you have any suggestions any kind of advice is appreciated and if you have a similar or the same problem then lets figure this out.

local Player = game:GetService("Players").LocalPlayer local Character = Player.Character local Portal = game:GetService("Workspace").PortalOne.Portal

function Navigate() if (Portal.Position - Character.Torso.Position).Magnitude < 20 then Portal.Transparency = 0 Portal.CanCollide = true Portal.PortalScript.Disabled = false end end

while true do Navigate() wait(0.1) end

0
Read this article which exlpains this common issue https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online Kryddan 261 — 8y
0
Thanks for the Help! I think i have fixed this! lacikaturai 89 — 8y

Answer this question