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

Remote Events aren't working?

Asked by 8 years ago
Edited 8 years ago

This is a normal script and this game is Filtering Enabled and giving items wont work. Can someone help?


tool = game.ReplicatedStorage.Tools.Banana local player = game.Players.LocalPlayer game.ReplicatedStorage.NetworkFolder.LOL.OnClientEvent:connect(function() tool:Clone().Parent = player.Backpack end)
--Another local script
script.Parent.ClickDetector.MouseClick:connect(function(plr)
    game.ReplicatedStorage.NetworkFolder.LOL:FireClient()
end)
0
Just do this in a local script Async_io 908 — 8y
0
Can I??? I thought you can only do this in a regular script. BennyBoiOriginal 293 — 8y

1 answer

Log in to vote
0
Answered by
1N0body 206 Moderation Voter
8 years ago

When a player tries to invoke this RemoteEvent, the player is automagically passed by. So:

local tool = game.ReplicatedStorage.Tools.Banana

game.ReplicatedStorage.NetworkFolder.LOL.OnServerEvent:connect(function(player)
    tool:Clone().Parent = player.Backpack
end)

Inside a localscript all you gotta do is:

game.ReplicatedStorage.NetworkFolder.LOL:FireServer()
0
I am using a click detector and I already did that. BennyBoiOriginal 293 — 8y
0
 The problem with what you edited now is that you can't fire a mouseclick(clickdetector) from a localscript. Use a script instead, the ClickDetector.MouseClick returns the player. 1N0body 206 — 8y
Ad

Answer this question