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 Coding Help?

Previous Thread :: Next Thread 
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
04 Nov 2013 05:22 PM
I would like to release a new Raygun Gamepass. There are 2 teams in this game. "Survivors" and "Zombies" If a person has this gamepass and is on the Survivors team, the raygun will be granted to them from inside the lighting. If the person is on the zombies team, the Raygun is restricted and is not given to the person.

Can you help me code this out? I am getting frustrated trying to. Credit is given to the person who helped me.
Report Abuse
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
04 Nov 2013 05:23 PM
Can anyone help me out?

You just got Quater-Term'd
Report Abuse
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
04 Nov 2013 05:27 PM
Anyone?

You just got Quater-Term'd
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
04 Nov 2013 05:28 PM
nice bucket.


also i wont code it for you. but i'll fix it for you


here's what you gotta do

set a variable for RayGun (put it in lighting)
set a variable for the team color the survivors are on.

lol = game.Players.LocalPlayer

if lol.TeamColor = survivors then
raygun:clone().Parent = lol


-- also check for id of gamepass
Report Abuse
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
07 Nov 2013 09:36 PM
I still can't put it togehter....

You just got Quater-Term'd
Report Abuse
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
07 Nov 2013 10:18 PM
help

You just got Quater-Term'd
Report Abuse
Ekkoh is not online. Ekkoh
Joined: 22 Oct 2012
Total Posts: 524
07 Nov 2013 10:53 PM
local GPWepName = "Raygun" -- Name of your ray gun inside lighting
local GPID = 0 -- your GamePassId

local GPWep = Game:GetService("Lighting"):FindFirstChild(GPWepName)
local GPS = Game:GetService("GamePassService")

if not GPWep then
print("Did not find '"..GPWepName.."' in Lighting.")
script:Destroy()
end

Game:GetService("Players").PlayerAdded:connect(function(plr)
if GPS:PlayerHasPass(plr, GPID) then
GPWep:Clone().Parent = plr:WaitForChild("StarterGear")
GPWep:Clone().Parent = plr:WaitForChild("Backpack")
end
end)

"To sing when you live and to sing when you die" - George Ragan
Report Abuse
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
08 Nov 2013 12:34 AM
I am looking for a team restriction.

How do I restrict the raygun from a certain team as in "Zombies" team. I don't want the zombies to receive it.

You just got Quater-Term'd
Report Abuse
Quorum is not online. Quorum
Joined: 25 Oct 2013
Total Posts: 4680
08 Nov 2013 12:45 AM
By using an 'and' when checking if they have the gamepass, and making it check the players 'TeamColor' (making sure it's not equal to that of the Zombie team).
Report Abuse
Ekkoh is not online. Ekkoh
Joined: 22 Oct 2012
Total Posts: 524
08 Nov 2013 11:16 PM
Because I'm bored.

local GPWepName = "Raygun" -- name of your ray gun inside lighting
local RestrictedTeam = "Zombies" -- name of restricted team
local GPID = 0 -- your GamePassId

local GPWep = Game:GetService("Lighting"):FindFirstChild(GPWepName)
local GPS = Game:GetService("GamePassService")
local Teams = Game:GetService("Teams")

if not GPWep then
print("Did not find '"..GPWepName.."' in Lighting.")
script:Destroy()
end

local function getTeam(color)
for _, t in pairs(Teams:GetChildren()) do
if t.TeamColor == color then
return t
end
end
end

Game:GetService("Players").PlayerAdded:connect(function(plr)
if GPS:PlayerHasPass(plr, GPID) then
plr.CharacterAdded:connect(function()
local t = getTeam(plr.TeamColor)
if t.Name ~= RestrictedTeam then
GPWep:Clone().Parent = plr.Backpack
end
end)
end
end)


"To sing when you live and to sing when you die" - George Ragan
Report Abuse
Ekkoh is not online. Ekkoh
Joined: 22 Oct 2012
Total Posts: 524
08 Nov 2013 11:17 PM
Forgot something

if t and t.Name ~= RestrictedTeam then


"To sing when you live and to sing when you die" - George Ragan
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