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

why wont alvinblox's tutorial go through?

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

0

oops

0

wheres the error

0

I am using alvinblox tutorial and there is not a error. the function just wont activate.

0

wheres the script that fires it 0:

0

added the others

0

sorry I am new at scripting. so I am following alvinblox's tutorials witch are made to teach you.

0

and if ur using alvinblox's videos, you should probably go to the newer tutorials.

0

I just looked at it and it says it was made about 3 years ago

0

if you put a print after "replicatedStorage.Remotes.Lift:FireServer()," will it print?

0

no

0

wait I was looking at the wrong code

0

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?

0

wot

0

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

0

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

0

not doing wot

0

not getting past line 14?

0

that means that is got pass the debounce value but not the leaderstats

0

it said 10:53:53.275 Got pass the Debounce Varible so it got pass line 14 just not 16

0

does it print "got pass debounce if statement"? if it does send leaderstat script

0

done

0

idk try if debounce.Value == false then

0

ok nvm. so ur leaderstats are Strength and Rebirths. You need to capitalize Strength and Rebirths when adding it

0

ok thx

0

  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

0

look in answer. it easier to see.

1 answer

✓ Accepted answer
-- this is what you did
player.leaderstats.strength.Value = player.leaderstats.strength.Value + 25 * (player.leaderstats.rebirths.Value + 1)
-- make sure strength is Strength. same with rebirths.
player.leaderstats.Strength.Value += 25 * (player.leaderstats.Rebirths.Value + 1)

8 comments

0

ohhhhhh. Thx this helps I thought you were talking about stats. thx!

0

uh it work now?

0

and probably also find a way to fire in local script or just use a script and no event cos idk how use modules :-;

0

wait no it auto does it

0

ye it fires every second. Probably make a local script in the tool and fire it when you use the tool. i not gud with tools ;-;

0

and delete the local script with while wait(1) do cos dat make it fire every second

0

ok, by the way it took a while for this respawnce because I was eating.

0

THX IT WORKS PERFECTLY NOW!!! WHEN I CLICK WITH THE ITEM IN MY HAND I GET 25+ STRENGTH AND THE COOLDOWN KEEPS ME FROM CLICKING UNDER A SECOND AFTERWORDS THANKS!!!!!!!

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