I am making a script which adds a tool to a players backpack when they click a button, I am using a remote event for this and was wondering how I would make it affect the player who fired the event only. Here is my script:
Local Script
local item = script.Parent
local tool = game.ReplicatedStorage.WoodenSword
local clonedTool = tool:Clone()
item.MouseButton1Click:connect(function()
game.ReplicatedStorage.RemoteEvent:FireServer()
end)
Server Script
local tool = game.ReplicatedStorage.WoodenSword
local clonedTool = tool:Clone()
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
clonedTool.Parent = game.Players.LocalPlayer.Backpack
end)
Thanks!
