Here is the code:

local Player = game.Players.LocalPlayer
local Leaderstats = Player:WaitForChild("leaderstats")


script.Parent.DialogChoiceSelected:connect(function(player,dialog)
 if dialog.Name=="Yes" then
	if Leaderstats.Cash.Value > 249999 then	
		Leaderstats.Cash.Value = 0
		Leaderstats.Rep.Value = 0
		Leaderstats.Rebirths.Value = Leaderstats.Rebirths.Value + 1
		end
 	end
end)

It for some reason doesn't work, idk why. I've tried it and tried it, but it still doesn't work. Please help me!

3 comments

0

Any errors that appear in 'Output' on Studio?

0

Why are you doing this in a local script?

0

It should be in a normal script?