Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you stop Roblox Studio from Detecting Hanging scripts?

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!

2 comments

0

What is your goal?

0

To stop Roblox from checking for hanging scripts.

1 answer

✓ Accepted answer
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

4 comments

0

Not my Goal, but it does fix the problem for that script.

0

How do you tell if a model causes lag on purpose, because stuff like that is happening on other scripts.

0

Nevermind, those were just repeats without a wait()

0

assuming that there isn't a way to achieve my goal, Ill accept the answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.