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 » Scripters
Home Search
 

Re: Can someone combine these 2 scripts into one?

Previous Thread :: Next Thread 
razor2425 is not online. razor2425
Joined: 06 Apr 2012
Total Posts: 1383
23 Jul 2015 01:21 PM
sorry im a noob at scripting

The team changer script

-----------------------------
tm = script.Parent

function onTouched(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local n = hit.Parent
local p = game.Players:FindFirstChild(""..n.Name.."")
if p ~= nil then
p.TeamColor = tm.BrickColor
end
end
end

script.Parent.Touched:connect(onTouched)
------------------------------------------

After it teams you, the kill script

-------------------------------------------
function KillPlayer(part)
h = part.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.Health = 0
end
end

script.Parent.Touched:connect(KillPlayer)
----------------------------------------
Report Abuse
darkemosoul is not online. darkemosoul
Joined: 13 Dec 2008
Total Posts: 458
23 Jul 2015 01:24 PM
function onTouched(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
h.Health = 0
local n = hit.Parent
local p = game.Players:FindFirstChild(""..n.Name.."")
if p ~= nil then
p.TeamColor = tm.BrickColor
end
end
end



-- Should do the exact same thing with out the extra script.
Report Abuse
razor2425 is not online. razor2425
Joined: 06 Apr 2012
Total Posts: 1383
23 Jul 2015 01:24 PM
Thanks a lot
Report Abuse
razor2425 is not online. razor2425
Joined: 06 Apr 2012
Total Posts: 1383
23 Jul 2015 01:25 PM
wait a sec that script dosent work
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
23 Jul 2015 01:36 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent then
local player = game.Player:GetPlayerFromCharacter(hit.Parent)
if player then
player.Teamcolor = script.Parent.BrickColor
hit.Parent:BreakJoints()
end
end
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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