You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Have a player equip a tool when they press a button -
What is the issue? Include screenshots / videos if possible!
the tool is retuning nil when I send it to a remote event -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Apparently I’m not supposed to put player on the client-side of a client to server remote event but IDK maybe that’s the issue
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
--Local
local player = game.Players.LocalPlayer
local BTN = script.Parent
local Frame = script.Parent.Parent
local Rem = game.Workspace.RemoteEvent
BTN.MouseButton1Click:Connect(function()
local tool = game.Workspace.Plushies[Frame.Name]:Clone()
print(tool.Name)
if not player[player.Name .. "Ownerships"][Frame.Name].Value then return end
local player = game.Players.LocalPlayer
Rem:FireServer(tool)
wait()
end)
--Server
local Rem = game.Workspace.RemoteEvent
Rem.OnServerEvent:Connect(function(player, tool)
local Char = player.Character
tool.Parent = Char
end)
Error; (on server) ToolChange:6: attempt to index nil with ‘Parent’
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.