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: Automatic Script for Teaming and Game Passes

Previous Thread :: Next Thread 
Verbero is not online. Verbero
Joined: 24 Jul 2013
Total Posts: 504
17 Mar 2014 07:06 PM
I have this so far:

if player:IsInGroup(1059543) then
player.Team = "Rangers"
repeat wait() until game.Workspace:FindFirstChild(player.Name)
player.Character:MoveTo(game.Workspace.SpawnerAid.Murica.Rangers.Position)
else
player.TeamColor = "Bright red"
repeat wait() until game.Workspace:FindFirstChild(player.Name)
player.Character:MoveTo(game.Workspace.SpawnerAid.Terrorland.Hostile.Position)
end

local rpg = game:GetService("GamePassService"):PlayerHasPass(player, 150064912)
if rpg == true or player.Name == "Player1" then
game.Lighting.RPG:clone().Parent = player.Backpack
game.Lighting.RPG:clone().Parent = player.StarterGear

local smaw = game:GetService("GamePassService"):PlayerHasPass(player, 150065119)
if smaw == true or player.Name == "Player1" then
game.Lighting.SMAW:clone().Parent = player.Backpack
game.Lighting.SMAW:clone().Parent = player.StarterGear


end
end





But it doesn't work. I have the spawns as the children, does this need to be a localscript or can it be a regular? Thanks for the help, I'm a pretty basic scripter.
Report Abuse
Verbero is not online. Verbero
Joined: 24 Jul 2013
Total Posts: 504
17 Mar 2014 07:11 PM
I updated it as a localscript to this:

if player:IsInGroup(1059543) then
player.Team = "Rangers"
game.Players.LocalPlayer.Character.Humanoid.Health=0
else
player.Team = "Hostiles"
game.Players.LocalPlayer.Character.Humanoid.Health=0
end

local rpg = game:GetService("GamePassService"):PlayerHasPass(player, 150064912)
if rpg == true or player.Name == "Player1" then
game.Lighting.RPG:clone().Parent = player.Backpack
game.Lighting.RPG:clone().Parent = player.StarterGear

local smaw = game:GetService("GamePassService"):PlayerHasPass(player, 150065119)
if smaw == true or player.Name == "Player1" then
game.Lighting.SMAW:clone().Parent = player.Backpack
game.Lighting.SMAW:clone().Parent = player.StarterGear


end
end



Still doesn't work
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
17 Mar 2014 07:23 PM
is that the entire script?
player is a variable that isn't defined, otherwise
-=Robo=-
Report Abuse
Verbero is not online. Verbero
Joined: 24 Jul 2013
Total Posts: 504
17 Mar 2014 07:27 PM
Would this fix it?

coroutine.resume(coroutine.create(function ()
game.Players.PlayerAdded:connect(function (player)
local lwr = string.lower(player.Name)
player.Neutral = false
if player:IsInGroup(1059543) then
player.Team = "Rangers"
game.Players.LocalPlayer.Character.Humanoid.Health=0
else
player.Team = "Hostiles"
game.Players.LocalPlayer.Character.Humanoid.Health=0
end

local rpg = game:GetService("GamePassService"):PlayerHasPass(player, 150064912)
if rpg == true or player.Name == "Player1" then
game.Lighting.RPG:clone().Parent = player.Backpack
game.Lighting.RPG:clone().Parent = player.StarterGear
end
local smaw = game:GetService("GamePassService"):PlayerHasPass(player, 150065119)
if smaw == true or player.Name == "Player1" then
game.Lighting.SMAW:clone().Parent = player.Backpack
game.Lighting.SMAW:clone().Parent = player.StarterGear


end
end)
end))
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