So the script detectes if the cash is greater then or equal too the rebirth cost so it works when you press the button once but when you go for a second time it does not work??
local rp = game:GetService("ReplicatedStorage")
local event = rp.Rebirth
local plr = game:GetService("Players").PlayerAdded:Wait()
event.OnServerEvent:Connect(function()
local othersutff = plr.OtherStuff
local rebirth = othersutff.rebirths
local rebirthcost = plr.OtherStuff.rebirthcost
local cash = plr.leaderstats.Cash
local wood = plr.leaderstats.Wood
if cash.Value >= rebirthcost.Value then
rebirthcost.Value *= 3.75
rebirth.Value = rebirth.Value + 0.1
math.ceil(rebirth.Value)
math.ceil(rebirthcost.Value)
cash.Value = 0
wood.Value = 0
print(rebirth.Value)
else
print("not enough money")
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you canât answer the three questions above, you should probably pick a different category.
can we get more detail on what is happening, like maybe print the cash value and the rebirthcost value before the if statement. Are you sure itâs not because you increase the rebirth cost by 3.75x every time your rebirth?
K, i found the issue but I still dont know what is going on, so when i print i says the cash value is zero but when I go to the folder that it is it says my value is above it.
Ut us satubg attenot ti ubdex buk wutg leaderstats, and what is the point of accualy using a localscript instead of a normal script? here is my convert script btw,
local Players = game:GetService("Players")
local leaderstats = Players.LocalPlayer.leaderstats
local wood = leaderstats.Wood
local cash = leaderstats.Cash
local multiplier = Players.LocalPlayer.OtherStuff.rebirths.Value
script.Parent.MouseButton1Click:Connect(function()
print(cash.Value)
cash.Value += wood.Value * multiplier
wood.Value = 0
end)
It comes up with my name in the error were the local player is so do i have to change it if it is a normal script, and i changed it to waitforchild leaderstats to see if that was the issue and now it is saying inex nil with waitforchild
so when the mouse button is clicked, you could fire an event to the server as the eventâs first variable thingy will always be the player who the event is coming from
I.E. On(type)Event:Connect(function(PlayerVariable)