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

[solved] Why isn't this changing a leaderstat? What have I done wrong?

Server script inside of serverscriptservice:

game.Players.PlayerAdded:Connect(function(plr)
	game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
		if plr.leaderstats.Memory.Value > 100 then
			plr.leaderstats.Memory.Value = plr.leaderstats.Memory.Value - 100
			plr.leaderstats.Deletes.Value = plr.leaderstats.Deletes.Value + 10
		end
	end)
end)

Local script in a textbutton:

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.RemoteEvent:FireServer()
end)

Output: No errors

What have I done wrong? (Yes, there is a remoteevent in replicatedstorage.)

1 answer

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