#Whats the issue with this script?

30 messages · Page 1 of 1 (latest)

quaint charm
#

local ISA1 = game.Workspace.REAL124.ISA1
local ISA2 = game.Workspace.REAL123.ISA1
cd = nil
Tool = script.Parent
Tool.Activated:connect(function()
local ran = math.random(1,2)
if ran == 1 then

    if cd == true then 
    print("CD IS TRUE")
    game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
    ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
    ISA2.Position = Vector3.new(118.694, 379.271, 271.076)
        
        
     elseif cd == false then
    cd = false
    print("CD IS FALSE")
    game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = true
    ISA1.Position = Vector3.new(103.716, 296.369, 247.498)
    ISA2.Position = Vector3.new(103.104, 296.394, -270.627)
        
        
    wait(3)
    print("CD IS TRUE")
    cd = true
    ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
    ISA2.Position = Vector3.new(118.694, 379.271, 271.076)
    game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
    game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = true
        
    wait(15)
    print("CD IS FALSE")
    cd = false
    game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = false
    
    
    
     elseif    ran == 2 then
    game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = true
    wait(0.5)
    game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = false
end
end
end)
#

Nothing works

errant raptor
#

I don't think any of what is there should work

quaint charm
merry brambleBOT
#

studio** You are now Level 6! **studio

quaint charm
#

I cant have cd = false there however because if you click the script then it simply just nullifies the cooldown

tidal seal
#

plz use ```lua

merry brambleBOT
#

studio** You are now Level 7! **studio

tidal seal
#

and ``` at the end

#

@quaint charm ^^^

tidal seal
#
local ISA1 = game.Workspace.REAL124.ISA1
local ISA2 = game.Workspace.REAL123.ISA1
cd = nil
Tool = script.Parent
Tool.Activated:connect(function()
    local ran = math.random(1,2)
    if ran == 1 then


        if cd == true then 
        print("CD IS TRUE")
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
        ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
        ISA2.Position = Vector3.new(118.694, 379.271, 271.076)


         elseif cd == false then
        cd = false
        print("CD IS FALSE")
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = true
        ISA1.Position = Vector3.new(103.716, 296.369, 247.498)
        ISA2.Position = Vector3.new(103.104, 296.394, -270.627)


        wait(3)
        print("CD IS TRUE")
        cd = true
        ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
        ISA2.Position = Vector3.new(118.694, 379.271, 271.076)
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
        game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = true

        wait(15)
        print("CD IS FALSE")
        cd = false
        game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = false



         elseif    ran == 2 then
        game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = true
        wait(0.5)
        game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = false
    end
    end
    end)
errant raptor
#

I recommend you to do that script again

quaint charm
# tidal seal ```lua local ISA1 = game.Workspace.REAL124.ISA1 local ISA2 = game.Workspace.REAL...

This doesnt work however

local ISA1 = game.Workspace.REAL124.ISA1
local ISA2 = game.Workspace.REAL123.ISA1
cd = nil
cd2 = nil
Tool = script.Parent
Tool.Activated:connect(function()
    local ran = math.random(1,2)
    if ran == 1 then
        cd = false


        if cd == true then 

        print("CD IS TRUE")
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
        ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
            ISA2.Position = Vector3.new(118.694, 379.271, 271.076)



         elseif cd == false then
        print("CD IS FALSE")
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = true
        ISA1.Position = Vector3.new(103.716, 296.369, 247.498)
            ISA2.Position = Vector3.new(103.104, 296.394, -270.627)
        cd = false


        wait(3)
        print("CD IS TRUE")
            cd = true
            cd2 = true
        ISA1.Position = Vector3.new(118.694, 379.271, 271.076)
        ISA2.Position = Vector3.new(118.694, 379.271, 271.076)
        game.Players.LocalPlayer.PlayerGui.TEST.TextLabel.Visible = false
        game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = true

        wait(15)
        print("CD IS FALSE")
        cd = false
        game.Players.LocalPlayer.PlayerGui.TEST.Dore.Visible = false



        elseif    ran == 2 then
        print("Ran Two")
        game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = true
        wait(0.5)
        game.Players.LocalPlayer.PlayerGui.TEST.RAH.Visible = false
        end
    end
end)

Does seem to work

#

The only issue is

#

The cd completely resets if you land on 1

#

And im aware that thats because wehn you land on 1 it instantly resets the cd

#

What im trying to do is figure out how to make the game detect that the cd is true before it changes to false immediately

#

But nothing seems to work

#

I was thinking about looping the cd being true until the cd is up

tidal seal
#

i meant use ```lua

quaint charm
#

But everytime i try to do that it just breaks

tidal seal
#

what should this code do?

quaint charm
# tidal seal what should this code do?

Teleports isa1 and isa2 the set position if you run the number one (and obviously applies the guis too) it all works, dore is the cd btw. Havent done 2 yet but ill get around to that shortly.

#

Rn the only issue us

#

Is

#

The cd reset

#

s

#

If you click the script

#

Again

#

And happen to land on 1