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
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
If has to have == and then.
so it will look like this
if Whatever == whatever then -- Code Here end
Put:
button.MouseButton1Down:connect(onclicked)