I am watching one of alvinblox's tutorials and I can not figure out what the problem is. I hear --that alvinblox's tutorials are out of date so that could be the problem. can anybody figure out why it will not go through my functions.
local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")
local cooldown = 1
replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)--this block is the error
print("Fired")
if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end
print("Got pass if statement")
local debounce = remoteData[player.Name].Debounce
print("Got pass the Debounce Varible")
if not debounce.Value then
print("got pass debounce if statement")
debounce.Value = true
player.leaderstats.strength.Value = player.leaderstats.strength.Value + 25 * (player.leaderstats.rebirths.Value + 1)
print("got pass leaderstats")
wait(cooldown)
debounce.Value = false
end
end)
print("Got to end")
local module = require(script.Parent:WaitForChild("ModuleScript"))
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
script.Parent.Activated:Connect(function()
module.Lift()
end)
local module = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
function module.Lift()
replicatedStorage.Remotes.Lift:FireServer()
end
return module
leaderstats script
local serverStorage = game:GetService("ServerStorage")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local strength = Instance.new("NumberValue")
strength.Name = "Strength"
strength.Parent = leaderstats
local rebirths = Instance.new("IntValue")
rebirths.Name = "Rebirths"
rebirths.Parent = leaderstats
local dataFolder = Instance.new("Folder")
dataFolder.Name = player.Name
dataFolder.Parent = serverStorage.RemoteData
local debounce = Instance.new("BoolValue")
debounce.Name = "Debounce"
debounce.Parent = dataFolder
end)

26 comments
oops
wheres the error
I am using alvinblox tutorial and there is not a error. the function just wont activate.
wheres the script that fires it 0:
added the others
sorry I am new at scripting. so I am following alvinblox's tutorials witch are made to teach you.
and if ur using alvinblox's videos, you should probably go to the newer tutorials.
I just looked at it and it says it was made about 3 years ago
if you put a print after "replicatedStorage.Remotes.Lift:FireServer()," will it print?
no
wait I was looking at the wrong code
uh if u do while wait(1) do game.ReplicatedStorage.Remotes.Lift:FireServer() end in a local script in starter player scripts, will it fire?
wot
it is now printing but not doing 10:53:53.275 Got pass if statement - Server - Remotes:11 10:53:53.275 Got pass the Debounce Varible - Server - Remotes:13 10:53:54.286 Fired - Server - Remotes:8
it is looping 10:53:53.275 Got pass if statement - Server - Remotes:11 10:53:53.275 Got pass the Debounce Varible - Server - Remotes:13 10:53:54.286 Fired - Server - Remotes:8
not doing wot
not getting past line 14?
that means that is got pass the debounce value but not the leaderstats
it said 10:53:53.275 Got pass the Debounce Varible so it got pass line 14 just not 16
does it print "got pass debounce if statement"? if it does send leaderstat script
done
idk try if debounce.Value == false then
ok nvm. so ur leaderstats are Strength and Rebirths. You need to capitalize Strength and Rebirths when adding it
ok thx
11:04:19.539 Fired - Server - Remotes:8 11:04:19.539 Got pass if statement - Server - Remotes:11 11:04:19.539 Got pass the Debounce Varible
look in answer. it easier to see.