attempt to index nil to 'Name' can you help me? Its for a weight lifting simulator.
I'm very new to coding and I'm very confused on why my code wont work. In the output section it says attempt to index nil to 'Name' can someone just make something
can just copy and paste in please?
Here is the code:
local player = game.Players.LocalPlayer
local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteData =game:GetService("ServerStorage"):WaitForChild("RemoteData")
local starterRebirthAmount = 5000
local cooldown = 1
replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)
01 | if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end |
03 | local debounce = remoteData [ player.Name ] .Debounce |
04 | if not debounce.Value then |
08 | player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 10 * (player.leaderstats.Rebirths.Value + 1 ) |
12 | debounce.Value = false |
end)
replicatedStorage.Remotes.Rebirth.OnServerInvoke = function()
01 | if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end |
03 | local rebirths = player.leaderstats.Rebirths |
05 | if player.leaderstats.Strength.Value > = (math.floor((starterRebirthAmount + (rebirths.Value * math.sqrt( 5000000 ))))) then |
07 | rebirths.Value = rebirths.Value + 1 |
09 | player.leaderstats.Strength.Value = 0 |
11 | player:LoadCharacter() |
14 | else return "NotEnoughStrength" |
end