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

How would you clone a weapon from server to the player in FE?

Asked by
Scaii_0 145
6 years ago

So I have a GUI in the player that when they click, its meant to clone a weapon into the Player. The weapon can't be in ReplicatedStorage for some reason as it breaks and when I try clone it from the client, it can't as it is in FE. The weapon is in Workspace.

This is what I had:

local button = script.Parent
button.MouseButton1Click:Connect(function(Player)
local weaponnew = game.Workspace.Weapon:Clone()
weaponnew.Parent = Player.Backpack
end)

1 answer

Log in to vote
1
Answered by 6 years ago

This is done by using RemoteEvents and/or functions. RemoteEvents/Functions are used to communicate with the server from the client (and opposite). You can read more about them here

To do what you want, you have to create a remoteevent in ReplicatedStorage and then get the cleint to send a request to it, and then the server receives this, makes sure they don't have the tool already.

Ad

Answer this question