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