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

why wont alvinblox's tutorial go through?

Asked by
xxaxxaz 42
3 years ago
Edited 3 years ago

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)
0
oops xxaxxaz 42 — 3y
0
wheres the error BulletproofVast 1033 — 3y
0
I am using alvinblox tutorial and there is not a error. the function just wont activate. xxaxxaz 42 — 3y
0
wheres the script that fires it 0: BulletproofVast 1033 — 3y
View all comments (22 more)
0
added the others xxaxxaz 42 — 3y
0
sorry I am new at scripting. so I am following alvinblox's tutorials witch are made to teach you. xxaxxaz 42 — 3y
0
and if ur using alvinblox's videos, you should probably go to the newer tutorials. BulletproofVast 1033 — 3y
0
I just looked at it and it says it was made about 3 years ago xxaxxaz 42 — 3y
0
if you put a print after "replicatedStorage.Remotes.Lift:FireServer()," will it print? BulletproofVast 1033 — 3y
0
no xxaxxaz 42 — 3y
0
wait I was looking at the wrong code xxaxxaz 42 — 3y
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? BulletproofVast 1033 — 3y
0
wot BulletproofVast 1033 — 3y
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 xxaxxaz 42 — 3y
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 xxaxxaz 42 — 3y
0
not doing wot BulletproofVast 1033 — 3y
0
not getting past line 14? BulletproofVast 1033 — 3y
0
that means that is got pass the debounce value but not the leaderstats xxaxxaz 42 — 3y
0
it said 10:53:53.275 Got pass the Debounce Varible so it got pass line 14 just not 16 xxaxxaz 42 — 3y
0
does it print "got pass debounce if statement"? if it does send leaderstat script BulletproofVast 1033 — 3y
0
done xxaxxaz 42 — 3y
0
idk try if debounce.Value == false then BulletproofVast 1033 — 3y
0
ok nvm. so ur leaderstats are Strength and Rebirths. You need to capitalize Strength and Rebirths when adding it BulletproofVast 1033 — 3y
0
ok thx xxaxxaz 42 — 3y
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 xxaxxaz 42 — 3y
0
look in answer. it easier to see. BulletproofVast 1033 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
-- 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)
0
ohhhhhh. Thx this helps I thought you were talking about stats. thx! xxaxxaz 42 — 3y
0
uh it work now? BulletproofVast 1033 — 3y
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 :-; BulletproofVast 1033 — 3y
0
wait no it auto does it xxaxxaz 42 — 3y
View all comments (4 more)
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 ;-; BulletproofVast 1033 — 3y
0
and delete the local script with while wait(1) do cos dat make it fire every second BulletproofVast 1033 — 3y
0
ok, by the way it took a while for this respawnce because I was eating. xxaxxaz 42 — 3y
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!!!!!!! xxaxxaz 42 — 3y
Ad

Answer this question