|
| 28 Feb 2015 03:28 PM |
Player = script.Parent.Parent.Parent.Parent
if Player.AlreadyHasIt.Value == true then script.Parent.Parent:Destroy() end
function Open() script.Parent.Visible = false wait(0.1) Player.Car.Frame.Visible = true end
script.Parent.MouseButton1Down:connect(Open)
Why did my script stop working when I made the if statement?
------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:29 PM |
| Is "AlreadyHasIt" a real function/command? Also, shouldnt there be only one '=' not two? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Feb 2015 03:31 PM |
FunkiAndrew
Does not work though.
------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:31 PM |
| @spicy, no, there should not be only one '=', there should be two. |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:32 PM |
spicyzombiekiller
There should be just one and AlreadyHasIt is a BoolValue.
------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:33 PM |
| hmmm maybe AlreadyHasIt isn't in Player? maybe it's in Player.PlayerGui. Just make sure. Because I don't see any errors in your script. what's the output? |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:34 PM |
Ah nvm I just made
local player = game.Players.LocalPlayer
then put player instead it works now thx guys.
------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:34 PM |
| When I use one '=' it works fine. |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:36 PM |
| @spicy, if statements have to have two '=' or they will not work. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 28 Feb 2015 03:38 PM |
"@spicy, if statements have to have two '=' or they will not work."
well...
local yes = false
local function well() if yes then print("YES") else yes = true print("NO") well() end end well() |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:50 PM |
I now added this
Player = script.Parent.Parent.Parent.Parent local player = game.Players.LocalPlayer
if player.AlreadyHasIt.Value == true then script.Parent.Parent:Destroy() player.PlayerGui.TeleportGui.Frame.Visible = true end
function Open() script.Parent.Visible = false wait(0.1) Player.Car.Frame.Visible = true end
And it gives me
I think ill have to use Player
22:44:34.348 - TeleportGui is not a valid member of PlayerGui 22:44:34.349 - Script 'Players.Player.PlayerGui.TycoonGui.Frame.TextButton.LocalSc', Line 5 22:44:34.349 - Stack End ------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:57 PM |
I just realised that the script is faster then the gui going from startergui to the PlayerGui.
------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊ |
|
|
| Report Abuse |
|
|