generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help

Previous Thread :: Next Thread 
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
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
spicyzombiekiller is not online. spicyzombiekiller
Joined: 10 Mar 2011
Total Posts: 77
28 Feb 2015 03:29 PM
Is "AlreadyHasIt" a real function/command? Also, shouldnt there be only one '=' not two?
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
28 Feb 2015 03:30 PM
make Player a local.
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
28 Feb 2015 03:31 PM
FunkiAndrew

Does not work though.

------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
28 Feb 2015 03:31 PM
@spicy, no, there should not be only one '=', there should be two.
Report Abuse
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
28 Feb 2015 03:32 PM
spicyzombiekiller

There should be just one and AlreadyHasIt is a BoolValue.

------------------------------------------------------------------------------------------------------------------------------------------------ #Handsomebob10 ☊✪✪☊
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
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
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
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
spicyzombiekiller is not online. spicyzombiekiller
Joined: 10 Mar 2011
Total Posts: 77
28 Feb 2015 03:34 PM
When I use one '=' it works fine.
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
28 Feb 2015 03:36 PM
@spicy, if statements have to have two '=' or they will not work.
Report Abuse
chimmihc is not online. 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
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
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
handsomebob10 is not online. handsomebob10
Joined: 25 Sep 2010
Total Posts: 8259
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image