everytime people rebirth the out put has a error the code is:
game.ReplicatedStorage.Milktest.OnServerEvent:Connect(function(player)
local milk = player.PlayerGui.ScreenGui.StatsValue.milk
local Coins = player.PlayerGui.ScreenGui.StatsValue.Coins
local Rebirths = player.PlayerGui.ScreenGui.StatsValue.Coins
local rebirthmultiplyer = player.PlayerGui.ScreenGui.StatsValue.Rebirthmultiplier
local ammountneededtorebirth = player.PlayerGui.ScreenGui.StatsValue.AmmountneededtoRebirth
local ammountperrebirth = player.PlayerGui.ScreenGui.StatsValue.Ammountperrebirth
local ammountperrebirth = theRebirth.Value * Rebirths.Value
milk.Value = milk.Value + 1
player.PlayerGui.ScreenGui.Frame.Rebirth.MouseButton1Click:Connect(function()
if Coins > ammountneededtorebirth then -- this is whats wrong here
Rebirths.Value = Rebirths.Value + 1
rebirthmultiplyer.Value = rebirthmultiplyer.Value + 0.1
theRebirth = ammountperrebirth
Coins = 0
end
end)
in this case the error would be " 08:42:44.653 - ServerScriptService.Main:37: attempt to compare userdata" but if i change the bit thats to .Value on both of the ends then i get this " 08:41:21.626 - ServerScriptService.Main:37: attempt to index number with 'Value'".

1 comment
please