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

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)

2 comments

0

There is no active click signal

0

how do i get a active click signal

1 answer

I think there is something wrong with your RemoteEvents.

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