So, I am making a game like "The complex v7". I throwback.. and in a certain part of the game you need to touch a part.. and then ScreenGui.Frame.Visible = true
so I tried
script.Parent.Touched:connect(Function) Game.StarterGui.ScreenGui.Frame.Visible = true end)
but that doesn't work..
can somebody please help me with this? I really need this!
Hey there. There's a big flaw with your code. Simple fix though. You can't index into StarterGui, which is why you have to do something different. You also have to put the code inside your function, not outside of it.
What I want you to do, is insert a LocalScript into your Frame. What a localscript does, is runs locally, so the frame wont appear on everyones frame.
Code:
local Frame = script.Parent --reference variable for the frame, which is script.Parent Frame.Visible = false --makes the frame disappear in the beginning game.Workspace.PARTNAME.Touched:Connect(function() --if your part it touched, then this function should run Frame.Visible = true --make the frame visible end)
Make sure to change PARTNAME, to your parts name, you want the Player to touch. Please try to understand the code, as it's better for you. I also highly suggest you try to learn scripting, because it will help you a LOT. Hope I helped, and have a good day.
This is very simple! Insert a LocalScript into your Frame and type the following script:
local Part = workspace.PARTNAME local Frame = script.Parent Frame.Visible = false --this just makes it invisible from the beginning Part.Touched:Connect(function() -- detects when its touched Frame.Visible = true --makes it visible end)