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

Previous Thread :: Next Thread 
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 10:57 PM
How would I make it so that a certain person spawns on a certain team the first time they enter the game?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Apr 2014 10:58 PM
http://wiki.roblox.com/index.php?title=PlayerAdded_(Event)
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:01 PM
I don't think that's what I am needing...
Report Abuse
Dakota99 is not online. Dakota99
Joined: 30 Aug 2007
Total Posts: 11628
01 Apr 2014 11:02 PM
game:GetService("Players").PlayerAdded:connect(function(ply)
ply.TeamColor=BrickColor.new("Bright red") -- always spawn on the red team
end)



------------------------------------------------------
don9 pls | twitter.com/sScriptis | RandomString: akuVr
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:14 PM
But I need it for specific players.
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
01 Apr 2014 11:15 PM
.-.
Leave please.
It`s obvious that you`ve either ignored the link or you have no idea how to script.
Report Abuse
Dakota99 is not online. Dakota99
Joined: 30 Aug 2007
Total Posts: 11628
01 Apr 2014 11:15 PM
Players={"Name","Chubs1995","Dakota99","Player1"}

game:GetService("Players").PlayerAdded:connect(function(ply)
for v in Players do
if ply.Name==v then
ply.TeamColor=BrickColor.new("Bright red") -- spawn on the red team
end
end
end)




----------------------------------------------------------------
maniacal laughter | twitter.com/sScriptis | RandomString: gUEyw
Report Abuse
Dakota99 is not online. Dakota99
Joined: 30 Aug 2007
Total Posts: 11628
01 Apr 2014 11:17 PM
@lamp
Would you kindly calm down?
It's scripting helpers, not link somebody to the wiki and tell them to go away.



------------------------------------------------------------------------------
borrow my knife in your stomach | twitter.com/sScriptis | RandomString: hX^L\
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:21 PM
It didn't work.

Script:

Players={"Chubs1995"}

game:GetService("Players").PlayerAdded:connect(function(ply)
for v in Players do
if ply.Name==v then
ply.TeamColor=BrickColor.new("Institutional white")
end
end
end)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Apr 2014 11:22 PM
i,ply in pairs(Players) do
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Apr 2014 11:23 PM
and more errors...
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
01 Apr 2014 11:26 PM
local plrs = {"PlayerNameHere","OtherPlayerNameHere","ThirdPlayerNameHere"}

game.Players.PlayerAdded:connect(function(plr)
plr:WaitForDataReady()
for i,v in pairs(plrs) do
if v == plr then
plr:CharacterAdded:connect(function(char)
char.Torso.CFrame = CFrame.new(x,y,z)
end)end end end)
Report Abuse
Dakota99 is not online. Dakota99
Joined: 30 Aug 2007
Total Posts: 11628
01 Apr 2014 11:26 PM
Please paste the errors from output.
View -> Output



-------------------------------------------------
yes | twitter.com/sScriptis | RandomString: cjoaq
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:31 PM
This was the only relevant output to the script.

23:30:52.354 - Script 'Workspace.SCRIPTS.Script1', Line 4
23:30:52.354 - stack end
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:34 PM
Goulstem, your script is telling me that it has the following error:

function arguments expected near ':'
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:45 PM
Actually, Dakota99, this is a more relevant output.

23:44:09.472 - Workspace.SCRIPTS.Script1:4: attempt to call a table value
23:44:09.473 - Script 'Workspace.SCRIPTS.Script1', Line 4
23:44:09.473 - stack end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
01 Apr 2014 11:46 PM
Typo;

plr:CharacterAdded:connect(function(char)

Change to;

plr.CharacterAdded:connect(function(char)
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:58 PM
So, it should look like this?

local plrs = {"Chubs1995"}

game.Players.PlayerAdded:connect(function(plr)
plr:WaitForDataReady()
for i,v in pairs(plrs) do
if v == plr then
plr.CharacterAdded:connect(function(char)
char.Torso.CFrame = CFrame.new(x,y,z)
end)end end end)

With x = -294
y = 1745.4
z = 312.998
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
01 Apr 2014 11:59 PM
-- Script I made that I use in all my games!
devs = {"KOTwarrior"}

for i,prodevs in pairs(devs) do
repeat wait() until game.Players:FindFirstChild(prodevs)
repeat wait() until game.Workspace:FindFirstChild(prodevs)
if game.Teams:FindFirstChild("Developers/Founder") then
print("already created")
game.Players[prodevs].TeamColor = game.Teams[team.Name].TeamColor
else
teams = game:GetService("Teams")
team = Instance.new("Team", teams)
team.Name = "Developers"
game.Teams[team.Name].TeamColor = BrickColor.new(1032)


game.Players[prodevs].TeamColor = game.Teams[team.Name].TeamColor
end
end
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
01 Apr 2014 11:59 PM
ROBLOX wouldn't let me post with the coordinates in the appropriate location for some reason.
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
02 Apr 2014 12:05 AM
KOTwarrior, so it's supposed to be this?

devs = {"Chubs1995"}

for i,prodevs in pairs(devs) do
repeat wait() until game.Players:FindFirstChild(prodevs)
repeat wait() until game.Workspace:FindFirstChild(prodevs)
if game.Teams:FindFirstChild("Gods") then
print("already created")
game.Players[prodevs].TeamColor = game.Teams[team.Name].TeamColor
else
teams = game:GetService("Teams")
team = Instance.new("Team", teams)
team.Name = "Gods"
game.Teams[team.Name].TeamColor = BrickColor.new(1001)


game.Players[prodevs].TeamColor = game.Teams[team.Name].TeamColor
end
end
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
02 Apr 2014 12:07 AM
Add it to your game, it should work.
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
02 Apr 2014 12:10 AM
k.
Didn`t realize that SH has turned into a place to give scripts to those who are not willing to learn/try.
Report Abuse
Dakota99 is not online. Dakota99
Joined: 30 Aug 2007
Total Posts: 11628
02 Apr 2014 12:10 AM
v in table only works so often
fixed supereffective code:
Players={"Name","Chubs1995","Dakota99","Player1"}

game:GetService("Players").PlayerAdded:connect(function(ply)
for _,v in pairs(Players) do
if ply.Name==v then
ply.TeamColor=BrickColor.new("Bright red") -- spawn on the red team
end
end
end)



--------------------------------------------------
yes | twitter.com/sScriptis | RandomString: Z\T\Z
Report Abuse
Chubs1995 is not online. Chubs1995
Joined: 02 Sep 2007
Total Posts: 339
02 Apr 2014 12:10 AM
It didn't work. It's not showing any errors, but there isn't an output for the script when I test it.
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