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

This script works perfectly in studio and doesn't work at all in game, why?

So basically, I made a stealth script for my group, it works perfectly in studio but doesn't do anything in game. This is the only error I'm getting

startScript re-entrancy has exceeded 3 07:33:54.608 - Script 'Players.Player1.Backpack.Stealth.LocalScript', Line 14 07:33:54.609 - Stack End

This is the script:

local tool = script.Parent
local debounce = false
local char = game.Players.LocalPlayer.Character
local tool = script.Parent
local ra = char["Right Arm"]
local la = char["Left Arm"]
local rl = char["Right Leg"]
local ll = char["Left Leg"]
local t = char["Torso"]--Variables
local h = char["Head"]
local invis = 0.86--Set to how visible you want the stealth to make you
local d = char:GetChildren()
script.Disabled = true
script.Disabled = false
tool.Selected:connect(function(mouse)
	script.Disabled = true
script.Disabled = false
    mouse.KeyDown:connect(function(key)
              if key == "q" then t.Transparency = invis ra.Transparency = invis--Stealth stuff
  la.Transparency = invis
 rl.Transparency = invis		
 ll.Transparency = invis
h.Transparency = invis 
    wait()	elseif key == "e" then
			 t.Transparency = 0 ra.Transparency = 0--UnStealth stuff
  la.Transparency = 0
 rl.Transparency = 0			
 ll.Transparency = 0
h.Transparency = 0  
wait() debounce = false
end  
 end)
end)
tool.Selected:connect(function(mouse)
    mouse.KeyDown:connect(function(key)              
if key == "q" then  for i=1, #d do 
		if (d[i].className == "Hat") then d[i].Handle.Transparency = invis 
			 wait() 
			end
		end
			end
		end)
		end)
		tool.Selected:connect(function(mouse)
    mouse.KeyDown:connect(function(key)
              if key == "e" then  for i=1, #d do 
		if (d[i].ClassName == "Hat") then d[i].Handle.Transparency = 0
			 wait() 
	end
		end
			end
		end)
		end)
		tool.Deselected:connect(function(mouse)
	t.Transparency = 0 ra.Transparency = 0--UnStealth stuff
  la.Transparency = 0
 rl.Transparency = 0			
 ll.Transparency = 0
h.Transparency = 0  
	for i=1, #d do 
		if (d[i].ClassName == "Hat") then d[i].Handle.Transparency = 0
			
			end
		end
end)

5 comments

0

Why are you disabling then enabling your script on line 14?

0

Well, for some reason for the hat transparency to work I had to disable and re-enable it.

0

Is this a tool, or just a script in the backpack. Just asking because it's Stealth.LocalScript. Try it without the tool

0

It's in a hopperbin

0

I know, but that hopperbin might not be necessary.

1 answer

The problem is you are disabling and enabling it. It will be disabled, then enabled, and repeated infinitely. You are exceeding the limit this is allowed to happen to prevent a nuclear meltdown at the servers. STOP TRYING TO NUKE ROBLOX MAN!

1 comment

0

ohhhh, let me open studio and make a quick edit and see if it works.

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