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

Can someone help me with a RenderStepped trouble?

Asked by 8 years ago

So...basically i created a tool that makes your arms visible (even in 1st person) while equipped,but i'm having a trouble with it. The RenderStepped event won't disconnect.

This is my first script (local script)

01tool=script.Parent
02 
03tool.Equipped:connect(function()
04    renderStepped=game:GetService('RunService').RenderStepped:connect(function()
05        tool.Parent['Right Arm'].LocalTransparencyModifier=0
06        tool.Parent['Left Arm'].LocalTransparencyModifier=0
07    end)
08end)
09 
10tool.Unequipped:connect(function()
11    renderStepped:disconnect()
12end)

then i tried to make a server script fire a remote event when it's unequipped

01--Server script
02 
03tool=script.Parent
04unequip=tool.Unequip
05 
06tool.Unequipped:connect(function()
07    unequip:FireClient(game.Players:GetPlayerFromCharacter(tool.Parent))
08end)
09 
10--Local script
11 
12tool=script.Parent
13unequipEvent=tool.Unequip
14 
15tool.Equipped:connect(function()
View all 24 lines...

none of this worked.

0
Try defining the :disconnet function and connection before the renderstepped function WingedHorizen201 124 — 8y
2
RenderStepped only works in a local script. JWBlueLbl 3 — 8y
0
@WingedHorizen201 I don't get it. If i define the disconnect function and the connection BEFORE the RenderStepped,the arms will not show up arthurgps2 67 — 8y
0
Oh, I must have worded it confusingly. What I mean is that you should move the connection for tool.unequip before tool.equip in your local script. WingedHorizen201 124 — 8y
View all comments (2 more)
0
I still don't get it arthurgps2 67 — 8y
0
bump ._. arthurgps2 67 — 8y

Answer this question