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

How do you get an item from server to client in FE?

So, a script in the player detects a click and is then meant to find a tool in ServerScriptService and clone it to the player.

So far when I try this:

--click function (works)
local plr = game.Players.LocalPlayer
local tool = game.ServerScriptService.Tool:Clone()
tool.Parent = plr

It says there is no tool. I understand this is because client can't access the server. But how would I get the tool over to the player?

4 comments

0

You can simply parent the tool to the player's character or backpack from the server. No need for a client.

0

But I can't access the tool because its in the server, but the script is in client.

0

Can’t you just use ReplicatedStorage instead? Both server and client can access it.

0

I've tried, but being in ReplicatedStorage interferes with the Tool's scripts.

1 answer

✓ Accepted answer

Local Script:

--click function
RemoteEvent:FireServer()

Server Script:

local tool = game.ServerScriptService.Tool

RemoteEvent.OnServerEvent:Connect(function(plr)
	local toolClone = tool:Clone()
	toolClone.Parent = plr
end)

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