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

Selling part in my simulator doesnt output any errors, and just does nothing?

I have a local script in my part thats called sellpart. heres the script

script.Parent.Touched:Connect(function(hit)
	local player = game.Players:FindFirstChild(hit.Parent.Name)
	if player then
		local sell = player.leaderstats.Trash
		local cash = player.leaderstats.Cash
		
		if sell.Value > 0 then
			cash.Value = cash.Value +sell.Value
			sell.Value = 0
		end
	end
end)

1 answer

✓ Accepted answer

You should be using a ServerScript not a LocalScript. It should still work the same nonetheless. Why it's not doing is anything is probably because you're doing it on the client then checking the server.

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