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

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

Asked by
Xoqex 75
10 years ago

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)
0
Why are you disabling then enabling your script on line 14? Spongocardo 1991 — 10y
0
Well, for some reason for the hat transparency to work I had to disable and re-enable it. Xoqex 75 — 10y
0
Is this a tool, or just a script in the backpack. Just asking because it's Stealth.LocalScript. Try it without the tool Orlando777 315 — 10y
0
It's in a hopperbin Xoqex 75 — 10y
0
I know, but that hopperbin might not be necessary. Orlando777 315 — 10y

1 answer

Log in to vote
1
Answered by
iaz3 190
10 years ago

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!

0
ohhhh, let me open studio and make a quick edit and see if it works. Xoqex 75 — 10y
Ad

Answer this question