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)


tool=script.Parent

tool.Equipped:connect(function()
	renderStepped=game:GetService('RunService').RenderStepped:connect(function()
		tool.Parent['Right Arm'].LocalTransparencyModifier=0
		tool.Parent['Left Arm'].LocalTransparencyModifier=0
	end)
end)

tool.Unequipped:connect(function()
	renderStepped:disconnect()
end)

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

--Server script

tool=script.Parent
unequip=tool.Unequip

tool.Unequipped:connect(function()
	unequip:FireClient(game.Players:GetPlayerFromCharacter(tool.Parent))
end)

--Local script

tool=script.Parent
unequipEvent=tool.Unequip

tool.Equipped:connect(function()
	renderStepped=game:GetService('RunService').RenderStepped:connect(function()
		tool.Parent['Right Arm'].LocalTransparencyModifier=0
		tool.Parent['Left Arm'].LocalTransparencyModifier=0
	end)
end)

unequipEvent.OnClientEvent:connect(function()
	renderStepped:disconnect()
end)

none of this worked.

6 comments

0

Try defining the :disconnet function and connection before the renderstepped function

2

RenderStepped only works in a local script.

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

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.

0

I still don't get it

0

bump ._.