Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why is the script not adding strength to the leaderboard?

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:FirstChild(player.name) then return "NoFolder" end
	
	local debounce = remoteData[player.name].Debounce
	
	if not debounce then
		debounce.Value = true
		
		player.Leaderstats.Strenght.Value = player.Leaderstats.Strenght.Value + 25 * (player.Leaderstats.Rebirths.Value + 1)
		
		wait(cooldown)
		
		debounce.Value = Faces

	end 
	
	
end)

3 comments

0

Is strength supposed to be spelled that way for you or did you spell it wrong and is there any errors

0

that is the roing skript

0

Any errors on console?

2 answers

local module = {}

local replicatedStorage = game:GetService("ReplicatedStorage")

function module .Lift()
	
	replicatedStorage.Remotes.Lift:FireServer()
	
end

return module

So, here is the fix,

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  --There is no function named 'FirstChild' I assume you mean 'FindFirstChild'

    local debounce = remoteData[player.name].Debounce

    if not debounce then
        debounce.Value = true

        player.Leaderstats.Strenght.Value = player.Leaderstats.Strenght.Value + 25 * (player.Leaderstats.Rebirths.Value + 1)

        wait(cooldown)

        debounce.Value = Faces

    end 


end)

If your code is still not working, Post a comment.

This discussion is preserved as it was. New answers, comments, and votes are closed.