everytime my character rebirths i get the error: 09:02:36.533 - ServerScriptService.Main:37: attempt to index number with 'Value' 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.Rebirths
local rebirthmultiplyer = player.PlayerGui.ScreenGui.StatsValue.Rebirthmultiplier
local ammountneededtorebirth = player.PlayerGui.ScreenGui.StatsValue.AmmountneededtoRebirth
local ammountperrebirth = player.PlayerGui.ScreenGui.StatsValue.Ammountperrebirth
local ammountperrebirth = ammountneededtorebirth.Value * Rebirths.Value
milk.Value = milk.Value + 1
local function Rebirth()
if Coins.Value > ammountneededtorebirth.Value then --this is whats wronh
Rebirths.Value = Rebirths.Value + 1
rebirthmultiplyer.Value = rebirthmultiplyer.Value + 0.1
ammountneededtorebirth = ammountperrebirth
Coins.Value = 0
end
end
player.PlayerGui.ScreenGui.Frame.Rebirth.MouseButton1Click:Connect(function()
Rebirth()
end)

3 comments
you missing 1 "end)"....
no i have it
In general, shorten every line with a variable: local statsValue = player.PlayerGui.ScreenGui.StatsValue local milk = statsValue.milk, etc. Also, is everything inside StatsValue a NumberValue, or what are their types