Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why is the script not adding strength to the leaderboard?

Asked by 4 years ago
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)
0
Is strength supposed to be spelled that way for you or did you spell it wrong and is there any errors laurenbtd5 379 — 4y
0
that is the roing skript kier1664 9 — 4y
0
Any errors on console? Leamir 3138 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
local module = {}

local replicatedStorage = game:GetService("ReplicatedStorage")

function module .Lift()

    replicatedStorage.Remotes.Lift:FireServer()

end

return module

Ad
Log in to vote
0
Answered by 4 years ago

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.

Answer this question