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 » Scripting Helpers
Home Search
 

Re: Help with one of my first scripts...

Previous Thread :: Next Thread 
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
04 Nov 2013 06:42 PM
Alright so this script is suppose to check if the user in the seat has purchased the right gamepass, and if the user has then the GUI will show up on their screen.
It is the first step to a script i am trying to make.
Sorry if this is bad... I usually stick to editing code, this is my first attempt from scratch.

passId = 133548879
N = script.Parent.Name

script.Parent.Touched:connect(function(Part)
if Part.Parent:FindFirstChild('Humanoid') then
local vCharacter = Part.Parent;
local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter);
if Game:GetService('GamePassService'):PlayerHasPass(vPlayer, passId) then
else
script.Parent.Parent.Parent:FindFirstChild(N.."Nos").Visible = true
end
end
end)
Report Abuse
RSFTheory is not online. RSFTheory
Joined: 31 Aug 2013
Total Posts: 315
04 Nov 2013 06:49 PM
Try removing the 'then' on line 8.

To me "then else" doesn't really make sense.
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
04 Nov 2013 06:51 PM
@RSF
he's actually just missing all of the code for that if statement
he needs code between line 8 and line 9
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 06:51 PM
That's not the problem
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 06:51 PM
jan ninja'd me btw
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
04 Nov 2013 07:04 PM
Bump
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
04 Nov 2013 07:06 PM
i dont think you need the else if that helps
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
04 Nov 2013 07:12 PM
I tried to remove it, it did not work.
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
04 Nov 2013 07:29 PM
Bump
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 04:33 PM
Bump
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
05 Nov 2013 04:38 PM
First say what you are trying to do.
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 04:40 PM
I did....
"Alright so this script is suppose to check if the user in the seat has purchased the right gamepass, and if the user has then the GUI will show up on their screen."
Report Abuse
Oozlebachr is not online. Oozlebachr
Joined: 30 Aug 2009
Total Posts: 22223
05 Nov 2013 04:41 PM
the code that would show the gui is supposed to go between "if Game:GetService('GamePassService'):PlayerHasPass(vPlayer, passId) then" and "else"

right now your script does nothing if the player passes the check
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 04:44 PM
So it should look like this?

passId = 133548879
N = script.Parent.Name

script.Parent.Touched:connect(function(Part)
if Part.Parent:FindFirstChild('Humanoid') then
local vCharacter = Part.Parent;
local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter);
if Game:GetService('GamePassService'):PlayerHasPass(vPlayer, passId) then
script.Parent.Parent.Parent:FindFirstChild(N.."Nos").Visible = true
else
end
end
end)

Instead of

passId = 133548879
N = script.Parent.Name

script.Parent.Touched:connect(function(Part)
if Part.Parent:FindFirstChild('Humanoid') then
local vCharacter = Part.Parent;
local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter);
if Game:GetService('GamePassService'):PlayerHasPass(vPlayer, passId) then
else
script.Parent.Parent.Parent:FindFirstChild(N.."Nos").Visible = true
end
end
end)

Correct?
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 04:55 PM
Bump, oh and i would put this script in the vehicles seat. Correct?
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 05:12 PM
bump...
Report Abuse
MrPoPoTheHobo is not online. MrPoPoTheHobo
Joined: 04 Dec 2011
Total Posts: 161
05 Nov 2013 06:04 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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