I have designed a script; When equipping a tool you have to take the name of the tool and print it, the problem is that it does it twice and puts the name of another tool (the first one I designed the script for); In Roblox Studio it works perfectly, but in Roblox Player it is a catastrophe.
Code:
local asset = script.Parent.Name
script.Parent.Equipped:Connect(funtion ()
sprint(asset)
end)
Results:
Revolver
AK
-It should be printed only once, and it does it 2 times.
The problem is that the script must take the name of the tool and then fire that chain to a remote event, the server receives it and it works perfectly, what happens is that in Roblox Player it doesn’t.
In roblox studio it works perfectly, but in roblox player it fires the remote event twice and with another tool that also has that script; This is not the first time it has happened to me, it usually happens when I Copy(Ctrl+A) and paste it into another script, or when duplicating a script. The script is well designed, it is a roblox mistake in my opinion; If you can advise me something, I would appreciate it. FireServe(Boolean,String(name of Animation, String(Name of tool)).
It is firing the remote event twice, when it should not be like that, since it is sent when the “scrip.Parent.Activated” function is fulfilled As I already mentioned, only in Roblox Player
I already solved it, it was a very stupid error, but I’m still with this RunService: UnbindFromRenderStep removed different functions with same reference name utility-focus-state-friendstatuslabel-shayleroviedo 2 times. It happens when I restart the player in Roblox Player. “shayleroviedo” is another player’s account.
I know that the error is from Roblox, but it has already happened to me in several games, I need a vague idea of ​​what generates it, since it ruins several scripts (I have been seeing this error in my codes for months, whether or not I use “RunService”. Thanks You.