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

How do you stop Roblox Studio from Detecting Hanging scripts?

Asked by 6 years ago

In one of my local scripts there is a reference towards local player:

local player = game.Players.LocalPlayer

but, Roblox Studio Detects it as a hanging script because the player has not loaded in yet. Then, no matter what I press(Break, Kill Script or just close out of prompt window), Roblox Studio Takes a long time to respond.

I don't think this is important, but until it is responsive, the stop and play button are both colored.

Even after it starts responding, it crashes when I try to open the tab of my game. Please Help!

0
What is your goal? royee354 129 — 6y
0
To stop Roblox from checking for hanging scripts. mikadog3 2 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
while not game.Players.LocalPlayer do wait() end
local player = game.Players.LocalPlayer

if that does not work then it is probably a different script, your example should just give a nil reference error and not hanging. it could possibly be a free model as people tend to put "viruses" in them with the purpose of lagging your game. and you should still wait for LocalPlayer to be set either way

0
Not my Goal, but it does fix the problem for that script. mikadog3 2 — 6y
0
How do you tell if a model causes lag on purpose, because stuff like that is happening on other scripts. mikadog3 2 — 6y
0
Nevermind, those were just repeats without a wait() mikadog3 2 — 5y
0
assuming that there isn't a way to achieve my goal, Ill accept the answer. mikadog3 2 — 5y
Ad

Answer this question