tarrdoJoin Date: 2008-06-24 Post Count: 476 |
if Workspace.Part.Touched
then script.Parent.Parent.Parent.StarterGui:findFirstChild(PrimaryShop) <- Nil Value
PrimaryShop.Visible = True
end |
|
|
Surround what you have in the parenthesis in quotes for findfirstchild
|
|
|
Also, I would use the touched event then connect a function to it that makes the gui visible
|
|
tarrdoJoin Date: 2008-06-24 Post Count: 476 |
I don't get what you mean isn't that the same thing? |
|
|
Not exactly, you can't use events with if statements. For connecting a function, the syntax is this:
function NAME(ARGUMENTS)
CODE
end
PART.Touched:connect(NAME())
Forgive me if I'm wrong, it's 1:43 AM here lol |
|
tarrdoJoin Date: 2008-06-24 Post Count: 476 |
function OnTouched(gui)
game.StarterGui.ScreenGui.PrimaryShop.Visible = True
end
part.Touched:connect(PrimaryShop(function))
So it would look like? |
|
|
Close, but not quite. I. On iPad right now, so I can't really copy and paste, I'll help you in the morning. |
|
tarrdoJoin Date: 2008-06-24 Post Count: 476 |
It's 4am here I'm 2 hours ahead of you haha :P |
|
|
Okay 1st when you want to give someone a Gui by touching something:
use:
function(hit)
player = game.Players:GetPlayerFromCharacter(hit)
Gui = YourNewGui
Gui.Parent - player.PlayerGui
end
script.Parent.Touched:connect(hit) |
|
tarrdoJoin Date: 2008-06-24 Post Count: 476 |
Well see giving them a gui isn't what I'm doing I am making a gui active because if I were to give them one I would have to script creating the gui and frame and everything. Would I not? |
|
|
Mine was just an example, but to access a player from a character you use
:GetPlayerFromCharacter(game.Workspace.Player) -- Or where ever you want the player to be indexed from |
|