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

Why Doesnt my Visible/Not Visible Script work? [SOLVED]

Asked by
istiyak 13
10 years ago

i made a script so that if you join a clan for example heroes, you get a certain GUI shop only available for the people that clicked on the text button Heroes. but if you joined the clan for example Enemies, you get access to the shop that is only available to enemies. i made 2 shops for each of them. called the hero one Hero Shop and enemies one Enemyshop. Also help me on line 4...

--I AM A NOOB AT SCRIPTING
function onclicked() 
    Intro.Frame.Uzumaki --- Actually Heroes so Intro.Frame.Heroes
    if = clicked(function) ---- Please explain why this is wrong or has a red line beneath it
        Uzumakishop.visible = true
        or if clicked.Uchiha ---Actually Enemies so if clicked.Enemies
            Uzumakishop.visible = false
        end
    end
    end

     function onclicked()
        Intro.Frame.Uchiha
        if = clicked(function) ---- Why Doesnt This Have a Line Benteath it?
        Uchihashop.visible = true
        or if clicked.Uchiha 
            Uzumakishop.visible = false
        end
        end
        end
        -- did this all by myself with all the knowledge i got on Lua, I even Checked the wiki on this and it didnt help me :(

but i improved my script!

function onclicked() 
    if onclicked() then Intro.Frame.Uzumaki --- Actually Heroes so Intro.Frame.Heroes
     =button.MouseButton1Down:connect(onclicked)
          Uzumakishop.Visible = true 
        if clicked.Uchiha ---Actually Enemies so if clicked.Enemies
            then Uzumakishop.Visible = false
    end
    end
    end

     function onclicked()
        if onclicked() then Intro.Frame.Uchiha
        =button.MouseButton1Down:connect(onclicked)
        Uchihashop.Visible = true
        if clicked.Uchiha 
            then Uzumakishop.Visible = false
        end
        end
        end

4 answers

Log in to vote
0
Answered by 10 years ago
if = clicked(function)

wouldn't make any sense because when using click you do

button.MouseButton1Down:connect(function()

end)

and if statements

if 5 > 3 then
    print("5 is greater than 3!")
end

If you wanted to make that work there'd have to be a lot more scripting put into that

0
why should i use if statements istiyak 13 — 10y
0
What? VariadicFunction 335 — 10y
0
you said i could use if statments, but i dont get if statements also i dont understand button.MouseButton1Down:connect(function() as i told you in the script... i am a noob at scripting istiyak 13 — 10y
0
You'd pretty much have to re-create everything and I don't really want to make everything for you but if you don't understand that stuff then you won't be able to make it at your current level of understanding VariadicFunction 335 — 10y
0
well you helped a lot istiyak 13 — 7y
Ad
Log in to vote
0
Answered by 10 years ago

If has to have == and then.

so it will look like this

if Whatever == whatever then
      -- Code Here

end
0
so in whatever i put clicked so, if clicked == uzumaki then... my code. is that what you mean? istiyak 13 — 10y
0
Probably if MouseButton1click == true then digitalzer3 123 — 10y
Log in to vote
0
Answered by 10 years ago

Put:

button.MouseButton1Down:connect(onclicked)
0
didnt work istiyak 13 — 10y
0
Then put script.Parent.MouseButton1Down:connect(onclicked) --Replace onclicked with the function It says onclicked on the thing at top so thats what I put. fireboltofdeath 635 — 10y
Log in to vote
0
Answered by
istiyak 13
10 years ago

i fixed the script! i edited the script on the description.

Answer this question