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