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

y is it not adding Strength to the leaderboard when I click?

Asked by 4 years ago
local module = require(script.Parent:WaitForChild("ModuleScript"))
local players = game.Players.LocalPlayer
local mouse = players:GetMouse()


script.Parent.Activated:Connect(function()
    module.Lift()


end)
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 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)
local module = {}

    local replicatedStorage = game:GetService("ReplicatedStorage")

    function module .Lift()

        replicatedStorage.Remotes:WaitForChild('Lift'):FireServer() -- Waits for 'Lift' to be replicated to client

    end

    return module

local serverStorage = game:GetService("ServerStorage")
    game.Players.PlayerAdded:Connect(function(plyer)

        local Leaderstats = Instance.new("Folder")
        Leaderstats.Name = "leaderstats"
        Leaderstats.Parent = plyer

        local Strength = Instance.new("NumberValue")
        Strength.Name = "Strength"
        Strength.Parent = Leaderstats


    local dataFolder = Instance.new("Folder")
    dataFolder.Name = plyer.Name
    dataFolder.Parent = game.ServerStorage.RemoteData


    local debounce = Instance.new("BoolValue")
    debounce.Name = "Debounce"
    debounce.Parent = dataFolder    

    end)

0
There is no active click signal Ziffixture 6913 — 4y
0
how do i get a active click signal kier1664 9 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I think there is something wrong with your RemoteEvents.

Ad

Answer this question