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: Why wont this work?

Previous Thread :: Next Thread 
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:01 PM
gpid = 297400359

GPS = game:GetService("GamePassService")
function respawned(char)
print("Respawned called for " .. char.Name)
local player = game.Players:GetPlayerFromCharacter(char)
if player then
print("Player found!")
if GPS:PlayerHasPass(player, gpid) then
script.Parent.Visible = true
end
end
end

how do I call the function cause I tried to call it in the print
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
16 Sep 2015 05:03 PM
hook it up to Player.CharacterAdded

--with Player properly defined:
Player.CharacterAdded:connect(respawned)
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:05 PM
It seems like this is going to be in a local script in a GUI Element so you'd probably rather do something along the lines of;

gpid=297400359
GPS = game:GetService('GamePassService')
if GPS:PlayerHasPass(game.Players.LocalPlayer.userId,gpid)
script.Parent.Visible
end
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:06 PM
whoops change that
script.Parent.Visible
to
script.Parent.Visible = true

i derped a bit
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:08 PM
gpid=297400359
GPS = game:GetService('GamePassService')
if GPS:PlayerHasPass(game.Players.LocalPlayer.userId,gpid) then
script.Parent.Visible=true
end
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:10 PM
omg thanks and btw I support your admin :D ^
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:10 PM
imo it's a piece of crud so I'm going to be making a new one sometime
but thanks for the support m8
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:16 PM
wait it broke for some reason again


gpid=297400359
GPS = game:GetService('GamePassService')
if GPS:PlayerHasPass(game.Players.LocalPlayer.userId,gpid) then
script.Parent.Visible = true
end

I tried this in both a script and local and it didn't work I also checked that the id was right
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:22 PM
oops sadly i forgot that PlayerHasPass won't work in LocalScripts in actual gameplay
You'll have to convert it to a script and either move to workspace(if you have FE)
if you don't have FilteringEnabled on then you can replace the current one with a script and paste the same code but replace
'game.Players.LocalPlayer' with
script.Parent.Parent.Parent or w/e would be the player
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:33 PM
are all the parent spose to lead to game? because if so I need more parents in the code
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:34 PM
you need like 2 less parents
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:35 PM
well if they lead into the game I need 3 more parents but idk where you wanted the parents to go to.
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:38 PM
where is your script located exactly in the game
like list it out like
game>StarterGui>ScreenGui>Frame>Script
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:41 PM
game>StarterGui>Gui>Frame>Frame>Button>script
Report Abuse
Scripth is not online. Scripth
Joined: 23 Jun 2013
Total Posts: 1724
16 Sep 2015 05:43 PM
plr=script.Parent.Parent.Parent.Parent.Parent.Parent
gpid=297400359
GPS = game:GetService('GamePassService')
if plr and GPS:PlayerHasPass(plr.userId,gpid) then
script.Parent.Visible = true
end
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
16 Sep 2015 05:50 PM
I still don't think it worked idk why I rechecked everything. I hate to waste your time it makes me feel bad when your tying to help me when u have work of your own u need to do
Report Abuse
JDLENL is not online. JDLENL
Joined: 23 Dec 2009
Total Posts: 1109
16 Sep 2015 05:51 PM
@spin: HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

HAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

HAHAHAHAHAHAHAHAHAHAhahahahahahahah...heh


Thanks.
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