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: Will Not Work WHY?

Previous Thread :: Next Thread 
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
11 Nov 2011 02:29 PM
It's a script that gives you a certain teleport-2-location GUI depending on your teamcolor. For some reason, it won't work.

----------------------------------------------------------------------------------------------------------
--Just put GUI's in the team.
function teamFromColor(color)
for _,t in pairs(game:GetService("Teams"):GetChildren()) do
if t.TeamColor==color then return t end
end
return nil
end

function onSpawned(plr)
local tools = teamFromColor(plr.TeamColor):GetChildren()
for _,c in pairs(tools) do
c:Clone().Parent = plr.StarterGui
end
end

function onChanged(prop,plr)
if prop=="Character" then
onSpawned(plr)
end
end

function onAdded(plr)
plr.Changed:connect(function(prop)
onChanged(prop,plr)
end)
end

game.Players.PlayerAdded:connect(onAdded)
----------------------------------------------------------------------------------------------------------

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
xSoulStealerx is not online. xSoulStealerx
Joined: 07 May 2008
Total Posts: 1624
11 Nov 2011 02:31 PM
You are cloning all the GUIs to player's StarterGUI. Which means, when you die, they will appear. But when the same part of the script is ran again, you will have duplicate GUIs. Try to make them parented to player's PlayerGui.
Report Abuse
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
11 Nov 2011 02:35 PM
Like this?

c:Clone().Parent = plr.PlayerGui

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
11 Nov 2011 03:23 PM
...
Hello?

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
11 Nov 2011 04:14 PM
Bawmp...

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
11 Nov 2011 05:09 PM
Bump V.2.

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
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