I am very confused

I am firing a remote event to give a user a tool.

Server:

Remotes.GiveTool.OnServerEvent:Connect(function(plr, plrToGive, tool)

print(plrToGive.Name)

print(tool.Name)

tool.Parent = plrToGive.Backpack

end)

Client:

Remotes.GiveTool:FireServer(plr, ticket:Clone())

Why wont it work???

It works if I want to give my self a ticket but not anybody else. Leading me to believe it is to do with the RemoteEvent

If you want to give all players the tool

U have to either fire the event from the server to all clients… or use two remote events (aka remote function) to send a signal from the client, to the server, and back to all of the clients.

When firing a signal to all clients, do

Remotes.GiveTool:FireAllClients()

/\ That would go into a ServerScript. The signal would be intercepted by a LocalScript in StarterPlayerScripts.

If you want to be the only one to get a tool

You have to set an argument for the LocalPlayer when the event is fired from the client.

Let’s say, if you click a GUI button, the LocalScript inside of the button will fire a remote event to the server.

In the ServerScript, u would use the argument “player” inside of “OnServerEvent”. Example:

Remote.GiveTool.OnServerEvent(player)

Use “player” to put the tool into the backpack:

tool.Parent = player.Backpack

You need to create a path to the remote event. (Unless you made ‘remote’ a variable already)

game.ReplicatedStorage.Remotes.GiveTool.OnServerEvent:Connect(function(plr, plrToGive, tool)

print(plrToGive.Name)

print(tool.Name)

local clone = tool:Clone()
clone.Parent = plrToGive.Backpack
local clone2 = clone:Clone()
clone2.Parent = plrToGive.StarterGear

end)
Client:

game.ReplicatedStorage.Remotes.GiveTool:FireServer(plr, ticket:Clone())

Remotes is already a variable.

1 Like

and there aren’t any output errors?

nope nbasdfbhasdfhahjsdfhjasdf

Look at my script above dpiwjwekrper

Why would you clone a clone?
asdasdasdasda

You should try to fire the name of the tool, and retrieve it inside the Server Side, because cloning a tool on a client doesn’t show for the server. (Filter Enabled) Just realized lol.

You need 2 clones one in the plrs backpack and one in the startergear

Why are you passing a clone instead of the real one’s name(so the server can know which tool to clone)?

This is very very very vulnerable to exploits. Exploiters can just pass whatever Instance to the server.

To make this safe, you can just pass a string instead then find the tool in Server Storage. Why server storage? Because some tools uses local script and if exploiter cloned it in their inventory, it will run the local script.

@FlashFlame_Roblox Yes, you can. But I don’t think even a scripter would do that.

1 Like

Filter Enabled stops this. Cloning in Client won’t show in server