-
What do you want to achieve? the strength going up when the player clicks the screen
-
What is the issue? it’s giving me an error saying that leaderstats is not a valid memeber of the player but when I check it, it’s there.
-
What solutions have you tried so far? I tried having the script
WaitForChild("leaderstats")
but that gave me an infinite yield error.
here’s the script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")
local cooldown = 1
ReplicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)
print("Fired")
if not RemoteData:FindFirstChild(player.Name) then return "No Folder" end
local debounce = RemoteData[player.Name].debounce
if not debounce.Value then
print("past debounce if statement")
debounce.Value = true
player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 10 * (player.leadersats.Rebirths.Value + 1)
wait(cooldown)
debounce.Value = false
end
end)
(dont mind the prints, I was doing debugging)