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: gamepass scripting help

Previous Thread :: Next Thread 
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
09 Jun 2014 01:22 AM
Hello, Im Trying to make a script that gives a player a weapon if he touches the block that the script is in. But if the person doesnt have agamepass, the script wont give the player a weapon...This is what i have soo far..PLEASE HELP!

gpid = 160467392

GPS = Game:GetService("GamePassService")
function OnTouched(part)
if GPS:PlayerHasPass(player, gpid) then
player = part.Players:FindFirstChild("Humanoid")
game.Lighting:FindFirstChild("Red Knife"):Clone().Parent = player.Backpack
end
end


script.Parent.Touched:connect(onTouched)



Thanks, BD


Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
09 Jun 2014 03:04 AM
player =game.Players:GetPlayerFromCharacter(Workspace.Player)
It would be more efficient if you used the PlayerAdded event for this.
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