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: Is there anythink wrong for my spawn button script?

Previous Thread :: Next Thread 
zarifprox is not online. zarifprox
Joined: 20 Nov 2012
Total Posts: 176
07 Feb 2014 11:36 PM
For my moving model/warrior/dog

debounce=true
color=BrickColor.new("Bright red")
colors={BrickColor.new("Nougat");BrickColor.new("Pastel brown");BrickColor.new("Brown");};

function tabFind(val,tablas)
for i,v in pairs(tablas) do
if val==v then
return i;
end end
return 0;
end

script.Parent.Touched:connect(function(part)
if debounce then
local a=game.Players:GetPlayerFromCharacter(part.Parent)
if a and a.WarriorCount.Value<6 and a.TeamColor==color then
debounce=false
local b=game.Lighting.Warrior:clone()
colo=colors[math.random(1,#colors)];
b.BC.HeadColor=colo;
b.BC.LeftArmColor=colo;
b.BC.RightArmColor=colo;
b.Master.Value=a
b.BC.LeftLegColor=color
b.BC.RightLegColor=color
b.BC.TorsoColor=color
b.Shield.BrickColor=color
b.wepo.Value=game.Lighting.sword;
b.Parent=workspace
b:MakeJoints()
b:MoveTo(workspace.RedWSpawn.Position)
a.WarriorCount.Value=a.WarriorCount.Value+1
local nameNom=math.floor(math.random(0,10000));
repeat nameNom=math.floor(math.random(0,10000)); until not (tabFind(nameNom,_G.takenNumbers)>0);
b.Name=b.Name .. " " .. nameNom;
local locr=false
for i=1,6 do
if not locr and not a[i].Value then
locr=true
a[i].Value=b
b.Humanoid.Died:connect(function()
a[i].Value=nil
table.remove(_G.takenNumbers,tabFind(nameNom,_G.takenNumbers));
end
)
end end
a.changeitup.Value=not a.changeitup.Value
Wait(2)
debounce=true
end end end
)
Report Abuse
zarifprox is not online. zarifprox
Joined: 20 Nov 2012
Total Posts: 176
07 Feb 2014 11:37 PM
Anything*
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
08 Feb 2014 02:21 AM
color should be BrickColor.new I believe...
Report Abuse
zarifprox is not online. zarifprox
Joined: 20 Nov 2012
Total Posts: 176
08 Feb 2014 03:36 AM
You mean this b.BC.HeadColor=colo; Should be b.BrickColor.new.HeadColor=colo; ?
Report Abuse
zarifprox is not online. zarifprox
Joined: 20 Nov 2012
Total Posts: 176
08 Feb 2014 01:48 PM
Bumb
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