Hello, i'm relatively new to coding, especially on Roblox.

I've stumbled upon an error in which whilst testing it doesnt give me strength (i'm making a simulator game) but instead reads: Realkyklops is not a valid member of Folder Here's the code if anyone could help, Sorry!

local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")

local cooldown = 1 

replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)
	
	if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end	

    local debounce = remoteData(player.Name).Debounce
    
    if not debounce.Value then
		debounce.Value = true
		
		player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 25 * (player.leaderstats.Rebirths.Value + 1)
		
		wait(cooldown)
		
		debounce.Value = false
	end
end)

3 comments

0

remoteData[player.Name] instead of remoteData(player.Name). also, you're not checking if the player has a leaderstat folder / if they have a strength value

0

Tyvm You helped me out Royal, thanks ever so much

0

:))