Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
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

5 comments

0

why should i use if statements

0

What?

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

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

0

well you helped a lot

If has to have == and then.

so it will look like this

if Whatever == whatever then
      -- Code Here

end

2 comments

0

so in whatever i put clicked so, if clicked == uzumaki then... my code. is that what you mean?

0

Probably if MouseButton1click == true then

Put:

button.MouseButton1Down:connect(onclicked)

2 comments

0

didnt work

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.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.