I have a GUI that gives a player a tool but it cant do it with FE on so I decided to use a RemoteEvent to trigger it and then give it to the player.
Here is the script(Located unter ServerScriptService)
local replicatedstorage = game:GetService("ReplicatedStorage")
local givetool = replicatedstorage:WaitForChild("RemoteEvent")
local player = game.Players.LocalPlayer
givetool.OnServerEvent:connect(function()
local weapon1 = replicatedstorage:WaitForChild("Thompson")
weapon1:Clone().Parent = player.Backpack
weapon1:Clone().Parent = player.StarterGear
end)
Here is the local script (Located under StarterGui.SurfaceGUI)
local replicatedstorage = game:GetService("ReplicatedStorage")
local givetool = replicatedstorage:WaitForChild("RemoteEvent")
local button = script.Parent:WaitForChild("Play")
button.MouseButton1Click:connect(function()
givetool:FireServer()
end)
The local script fires after pressing a button and then it triggers but it errors where it says "weapon1:Clone().Parent = player.Backpack. It says basically cant upvote player because its a nil value.

1 comment
You can't use LocalPlayer in a server script. http://wiki.roblox.com/index.php?title=API:Class/Players/LocalPlayer