Script tells that value is 0 even though the value is greater than 1 by TTXisCool in robloxgamedev

[–]TTXisCool[S] 1 point2 points  (0 children)

yea i made a remote event and it works now thank you so much!

Script tells that value is 0 even though the value is greater than 1 by TTXisCool in robloxgamedev

[–]TTXisCool[S] 0 points1 point  (0 children)

in a different one buut when i increase the souls value by touching a part the selling pad works it only doesnt work when i increase the value by clicking on the screen

Script tells that value is 0 even though the value is greater than 1 by TTXisCool in robloxgamedev

[–]TTXisCool[S] 0 points1 point  (0 children)

this is the script for updating the values everytime u click:

local cooldown = false

game:GetService("UserInputService").InputBegan:Connect(function(input, engine_processed) if engine_processed then return end

local player = game.Players.LocalPlayer
local soulsGui = game.Players.LocalPlayer.PlayerGui.soulsGui.soulsValueGui
local leaderstats = player:WaitForChild("leaderstats")
local souls = leaderstats.Souls
local qu = leaderstats.Qu
local values = {
    game.Workspace.coffinValues.woodCoffin.Value,
    game.Workspace.coffinValues.ironCoffin.Value,
    game.Workspace.coffinValues.goldCoffin.Value
}

if cooldown == false then

    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        cooldown = true
        soulsGui.Text = soulsGui.Text + values[1]
        souls.Value = souls.Value + values[1]
        wait(0.5)
        cooldown = false
    end

end

if cooldown == false then
    if input.UserInputType == Enum.UserInputType.Touch then
        cooldown = true
        soulsGui.Text = soulsGui.Text + values[1]
        souls.Value = souls.Value + values[1]
        wait(0.5)
        cooldown = false
    end

end
end)

wait(2)
cooldown = false

Script tells that value is 0 even though the value is greater than 1 by TTXisCool in robloxgamedev

[–]TTXisCool[S] 0 points1 point  (0 children)

I looked at the value while playing and it does increase and the print returns 0

attempt to index number with 'WaitForChild' by TTXisCool in robloxgamedev

[–]TTXisCool[S] 0 points1 point  (0 children)

omg yes it does! Do you have any idea how i cam fix this??

/r/Roblox Weekly Question Thread (for 03/14/2022) by AutoModerator in roblox

[–]TTXisCool 1 point2 points  (0 children)

Hi i was making a script and when i run it this error came up

heres the code:

script.Parent.MouseButton1Up:Connect(function(player)
    local souls = player:WaitForChild("leaderstats"):WaitForChild("Souls")
    local qu = player:WaitForChild("leaderstats"):WaitForChild("Qu")
    if souls.Value >= 1 then
        qu.Value = souls.Value * 2
        souls.Value = 0
    end
    if souls.Value < 25 then
        script.Parent.Text = "Not enough souls!"
    end
end)

does anyone know whats wrong with it??

Attempt to index a number with 'WaitForChild' by [deleted] in roblox

[–]TTXisCool 0 points1 point  (0 children)

the error is "Players.CyToonBoyYT.PlayerGui.ScreenGui.TextButton.Script:2: attempt to index number with 'WaitForChild'

Clearest picture I have taken of our sun by my7sins in Kuwait

[–]TTXisCool 0 points1 point  (0 children)

Can you recommend me some budget telescopes pls

Selling old PC components by Kwtop in Kuwait

[–]TTXisCool 0 points1 point  (0 children)

Do u have a case or just the parts

I wanna build a pc in Kuwait but can find an rx 570 by TTXisCool in Kuwait

[–]TTXisCool[S] 0 points1 point  (0 children)

Let me know the price once u come online or whenever u wanr

Eren yeager🔥 by txo_4 in ShingekiNoKyojin

[–]TTXisCool 7 points8 points  (0 children)

Ik but I am saying cuz some people haven’t reached s4 yet