of     1   

3lex33
#63487728Sunday, February 26, 2012 6:19 PM GMT

player = script.Parent.Parent.Parent gui = player.PlayerGui.Game inv = {gui.Coins, gui.Help1, gui.Help2, gui.Help3, gui.Help4, gui.Leave, gui.Cover, gui.Branches, gui.Fairflyes} function onSelected(mouse) for i = 1, #inv do inv[i].Visible = true end end function onDeselected(mouse) for i = 1, #inv do inv[i].Visible = true end end script.Parent.Selected:connect(onSelected) -- Selected comes with a mouse. script.Parent.Deselected:connect(onDeselected) This shows all gui only once. Also, the script dont hide guis on tool disselect. After tool stops working. How do i fix it?
3lex33
#63532960Monday, February 27, 2012 1:56 PM GMT

No replyes? D= The output dont show any error. I also noticed, that deselection function makes GUI visible too, but it still dont explains, why tool dont work onto respawn.
stravant
Forum Moderator
#63533139Monday, February 27, 2012 2:13 PM GMT

You may need the script to wait and make sure that the PlayerGui is actually there. The game may run the tool before it gets created. Use something like this: while not player:FindFirstChild("PlayerGui") do player.ChildAdded:wait() end
3lex33
#63533429Monday, February 27, 2012 2:34 PM GMT

I will try it soon(my studio hanged for a bit, cant test now). I wonder if why my check did not work: repeat until player:FindFirstChild("PlayerGui")~=nil
stravant
Forum Moderator
#63533536Monday, February 27, 2012 2:39 PM GMT

That has nothing to make it wait, so it will just keep looping forever and not give Roblox a chance to add the PlayerGui. The good news is that the fact that it hanged means that the PlayerGui being missing was what was breaking it =P You can fix it by doing either of the following instead: repeat wait() until player:FindFirstChild("PlayerGui")~=nil Or what I posted before.

    of     1