|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
| |
|
|
| 04 Nov 2013 07:06 PM |
| i dont think you need the else if that helps |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2013 07:12 PM |
| I tried to remove it, it did not work. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 05 Nov 2013 04:38 PM |
| First say what you are trying to do. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 05 Nov 2013 04:55 PM |
| Bump, oh and i would put this script in the vehicles seat. Correct? |
|
|
| Report Abuse |
|
|
| |
|
| |
|