y is it not adding Strength to the leaderboard when I click?
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)