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

Non visible buttons still kinda clickable?

Asked by
nicros 165
8 years ago

so im very confused, ive got a teleport book that has teleports u click on, when u click on 1 it sets a 5 minute cooldown for all of them, i did the cooldown by making the buttons Visible = falseand after 300 seconds Visible = trueyoull see in the script....but my problem is, the very first teleport even when Visible = false is clickable, it wont telelport you but it resets the 5 minute timer that shows up above the teleports, and i dont know why.

here are my scripts

any help pointing out whats causing this is appreicated

Button script

local reqLevel = 1
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function()
    if player.leaderstats.Lvl.Value >= reqLevel and player.Character then
        player.Character:MoveTo(Vector3.new(173.51, 385.797, 118.025))
        script.Parent.Parent.Time.Visible = true
        script.Parent.Parent.Bool.Value = true
        script.Parent.Visible = false
        script.Parent.Parent.tele2.Visible = false
        script.Parent.Parent.tele3.Visible = false
        script.Parent.Parent.tele4.Visible = false
        script.Parent.Parent.tele5.Visible = false
        script.Parent.Parent.tele6.Visible = false
        script.Parent.Parent.tele7.Visible = false
        script.Parent.Parent.tele8.Visible = false
        wait(300)
        script.Parent.Visible = true
        script.Parent.Parent.tele2.Visible = true
        script.Parent.Parent.tele3.Visible = true
        script.Parent.Parent.tele4.Visible = true
        script.Parent.Parent.tele5.Visible = true
        script.Parent.Parent.tele6.Visible = true
        script.Parent.Parent.tele7.Visible = true
        script.Parent.Parent.tele8.Visible = true
    end
end)

and here is the script i use for my Cooldown countdown timer


min = 59 hour = 5 function clicked() min = 59 hour = 5 script.Parent.Text = "0:00" end script.Parent.MouseButton1Down:connect(clicked) while wait(1) do if script.Parent.Parent.Bool.Value == true then min = min - 1 if min == 0 then min = 59 hour = hour -1 elseif hour == 0 then script.Parent.Parent.Bool.Value = false script.Parent.Visible = false end if min <=9 and hour<=9 then script.Parent.Text = "Cooldown - "..hour..":0"..min.."" elseif hour<=9 and min<= 9 then script.Parent.Text = "Cooldown - "..hour..":0"..min.."" elseif hour<=9 then script.Parent.Text = "Cooldown - "..hour..":"..min.."" else script.Parent.Text = "Cooldown - "..hour..":"..min.."" end end end

thanks :)

1 answer

Log in to vote
1
Answered by 8 years ago

Visible doesn't mean its not clickable, it just can be seen, you need to do this

script.Parent.Active = false

Hope this helps

0
Hope that helped :P join my party ghosteffectz 115 — 8y
0
well, i tried that and its still clickable which resets my timer but doesnt teleport me, and its only button 1 not my 7 others which run the same code with the exception the line script.Parent.Visible = false nicros 165 — 8y
Ad

Answer this question