Shop system troubles

i dont want a seperate server event per item in my shop so im tryna create a way to send over the tool name. problem is it turns nil after going through the event. need help.
I wanna do if tool == Hammer then type thing
LOCAL

local tool = "Hammer"


script.Parent.Activated:Connect(function(player)
	game.ReplicatedStorage.Shop:FireServer(player, tool) 
	print(tool)
end)

SERVER

game.ReplicatedStorage.Shop.OnServerEvent:Connect(function(player, tool)
	print("fired")
	print(tool)
end)

image

When you fire a remote the first argument is always the player you dont need to pass it

script.Parent.Activated:Connect(function(player)
	game.ReplicatedStorage.Shop:FireServer(tool) 
	print(tool)
end)

@Rogue_Vip3r

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.