|
| 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 |
|
|
|
| 04 Nov 2013 05:23 PM |
Can anyone help me out?
You just got Quater-Term'd |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2013 05:27 PM |
Anyone?
You just got Quater-Term'd |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 07 Nov 2013 09:36 PM |
I still can't put it togehter....
You just got Quater-Term'd |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2013 10:18 PM |
help
You just got Quater-Term'd |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|