RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 03:52 PM |
This script is suppose to detect whether one owns a specific gamepass, if owned, the GUI is visible, if not owned, the GUI is not visible. This is what I've done.
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end game.Players.PlayerAdded:connect(function(plr) if authenticate(plr) then if (passId = 93044440 ) then then game.StarterGUI.Teleport.Visible = true else game.StarterGUI.Teleport.Visible = false end end) -- by RoyMer |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 03:58 PM |
| Output: Workspace.VIP:10: ')' expected near '=' |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2012 03:59 PM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
game.Players.PlayerAdded:connect(function(plr) if authenticate(plr) then if (passId == 93044440 ) then then game.StarterGUI.Teleport.Visible = true else game.StarterGUI.Teleport.Visible = false end end) -- by RoyMer |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 04:00 PM |
| Output: Workspace.VIP:11: unexpected symbol near 'then' |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2012 04:01 PM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
game.Players.PlayerAdded:connect(function(plr) if authenticate(plr) then if (passId == 93044440 ) then game.StarterGUI.Teleport.Visible = true else game.StarterGUI.Teleport.Visible = false end end) -- by RoyMer |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 19 Nov 2012 04:04 PM |
| After then dont put another then in the next line.. |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 04:05 PM |
| Trying to write something but getting an error. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2012 04:07 PM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:wait() if authenticate(plr) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end) -- by RoyMer |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 04:11 PM |
| @thedeathmaster01, it's not giving me any output but it's not working, the script has to be in the workspace, right? |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2012 04:15 PM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(fuction(char) if authenticate(plr) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end) end) -- by OxxOmmok
ipprova b'dan.
u taghmiliex solo, ghamel server. k? |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 04:22 PM |
| None are working as I want them to work, does the script have to be in the workspace? |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 19 Nov 2012 04:27 PM |
| It's not giving me any output yet it's not working :/ |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 04:10 AM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function authenticate(player) -- checks to see if the player owns the pass return game:GetService("GamePassService"):PlayerHasPass(player, passId) end
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(fuction(char) if authenticate(plr) then plr.PlayerGui.Teleport.Visible = true elseif passId ~= 9304440 then plr.PlayerGui.Teleport.Visible = false end end end) -- by RoyMer Still not working |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 05:41 AM |
Output? No output then, once you run the script, reset because sometimes Guis dont appear straight away in startergui, you would have to interact with the player's gui.
~A3~ |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 05:44 AM |
Try this, Its a little inefficient but as long as it works, its fine.
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(fuction(char) if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end end) -- by RoyMer Still not working
Oh and no need for that "elseif passId ~=" blah, just a simple else statement would do.
~A3~ |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 06:07 AM |
| Wow that worked but now there's another problem, when I die or reset the GUI doesn't appear back. |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 06:14 AM |
Yeh it wouldnt, because the script only works when a player enters. Wait I'll figure a way out.
~A3~ |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 06:17 AM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
function check() if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end
game.Players.PlayerAdded:connect(function(plr) if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end plr.CharacterAdded:connect(function() check() end) end) -- By RoyMer, Edited by: awas3
~A3~ |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 06:20 AM |
| It still isn't appearing after respawn :/ |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 06:26 AM |
local passId = 93044440 -- Pass ID permission = {""} -- People that may pass without the game pass
game.Players.PlayerAdded:connect(function(plr) if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end plr.CharacterAdded:connect(function()
while true do wait() if game:GetService("GamePassService"):PlayerHasPass(player, passId) then plr.PlayerGui.Teleport.Visible = true else plr.PlayerGui.Teleport.Visible = false end end
-- By RoyMer, Edited by: awas3
~A3~ |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 20 Nov 2012 06:27 AM |
Or if it doesnt work, on the while true do bit, third line, replace "player" with game.Players.LocalPlayer and put the code into a LocalScript.
~A3~ |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 06:32 AM |
could I do player = game.Players.LocalPlayer to shorten a bit? |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 06:41 AM |
| Nevermind, the code before did work, I might have done some mistake while testing it. |
|
|
| Report Abuse |
|
|
RoyMer
|
  |
| Joined: 06 Jan 2010 |
| Total Posts: 1922 |
|
|
| 20 Nov 2012 06:42 AM |
Thank you all who helped me.
-- Thread Closed -- |
|
|
| Report Abuse |
|
|