Sell System Not Working

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
	print("WORKING")
	local leaderstats = player:FindFirstChild("leaderstats")
	local cash = leaderstats:FindFirstChild("Cash")
	local coal = leaderstats:FindFirstChild("Coal")
	cash.Value = cash.Value + 1
	coal.Value = coal.Value - 1
end)

Is the local script parented in StarterGui?

1 Like

Both scripts are parented to the coal sell button
WADMKKADWALMKWD

Server scripts will not run when parented to game clients.
For a server script to run it must be placed in ServerScriptService

2 Likes

You need to place your Script inside ā€˜ServerScriptServiceā€™ for it to run properly.

1 Like

Oh so I cannot put server scripts everywhere?
Ill make sure not to make the same mistake

You can using run context, change the scripts run context to server and there you go put it anywhere

To help you in the future, make sure to include the scripts parents so we can help you quicker.

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