Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Remote Events aren't working?

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)

2 comments

0

Just do this in a local script

0

Can I??? I thought you can only do this in a regular script.

1 answer

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()

2 comments

0

I am using a click detector and I already did that.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.