Im trying to create a grenade script via a massive framework localscript which fires an event to the local sided grenade in your hand which plays the fuse sound when you hold click and then when you let go it sends the event to the local grenade in your hand which deletes itself and then fires an event to the serverscript to create a new server grenade to throw in the direction of the mouse
everything should work but for some reason the local grenade doesnt pick up the event being fired
if you have any idea why this is happening please let me know thank you
If you are going LocalScript to LocalScript on the same client/player as you seem to be doing, you need a BindableEvent instead of a RemoteEvent.
If you are going LocalScript to LocalScript between clients/players, you need to use LocalScript -> RemoteEvent -> Script -> RemoteEvent -> LocalScript
mouse.Button1Down:Connect(function()
if weapons[holding] ~= nil then
if holding == "explosive" then
weapons[holding].Use:Fire()
end
end
end)
mouse.Button1Up:Connect(function()
if weapons[holding] ~= nil then
if holding == "explosive" then
weapons[holding].Throw:Fire()
end
end
end)
Legend {Origin = origin script, Reciever = receiver script}
Use Bindable Functions
BindableFunctions are:
Origin to Reciever to Origin
That saves most of the work, now just fire the remote on the origin to the server script
ok so I know the issue, the issue is that i completely forgot that local scripts only run if under a player, a character and a backpack. Thanks to the people who tried to help!
Dude what i don’t understand is why you don’t use 1 local script to handle local stuff, and 1 remote event to handle damage and stuff like that on a server script.
Forwarding data from one localscript to another in this context is useless. It is cleaner and better to just play the pin sound and throw animation in one tool.activated event, then fire the remote to handle explosions and damage on the server.