i want to know what is going on with my code and why my leader stats cash wont go down when i rebirth but when i rebirth the cash does not go down in the leaderstats and stays the same. i have tried to slove this for a good 2 hours but cant figure out whats causing this outcome i’m not sure what script this has to do with though.
local open = false
local player = game.Players.LocalPlayer
script.Parent.RebirthButton.MouseButton1Click:Connect(function()
if open == false then
script.Parent.Frame.Visible = true
script.Parent.RebirthButton.Text = "You need"..((player.leaderstats.Rebirths.Value+1)*2000).."to rebirth."
open = true
else
script.Parent.Frame.Visible = false
open = false
end
end)
script.Parent.Frame.RebirthButton.MouseButton1Click:Connect(function()
if player.leaderstats.Cash.Value >= ((player.leaderstats.Rebirths.Value+1)*2000) then
game.ReplicatedStorage.RemoteEvents.Rebirth:FireServer()
script.Parent.Frame.RebirthButton.Text = "Sucessfully Rebirthed"
wait(2)
script.Parent.Frame.Visible = false
open = false
script.Parent.Frame.RebirthButton.Text = "Rebirth"
end
end)
Put a print before and after checking the cash in that if statement and see if it goes through. If it does then it’s an issue with whatever server script handles this.
Where does that :FireServer() go to? Can you show us the server-side?