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: Friendly/Enemy Targeting with Billboard-Gui's. Help?

Previous Thread :: Next Thread 
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
15 Apr 2012 08:17 PM
Hello,

My code shown below is suppose to create a billboardgui based upon a bunch of "if" event's to show if the plane is an Enemy or a friendly plane. I tried to do it but I get no billboardgui's and no output.

game.Players.PlayerAdded:connect(function(newPlayer)
local friendlyMarker = "http://www.roblox.com/asset/?id=77694350"
local enemyMarker = "http://www.roblox.com/asset/?id=77694363"
function findPlanes()
for _,v in pairs(game.Workspace:GetChildren()) do
if (v:IsA("Model")) and (v:findFirstChild("Humanoid")) then
if (v:IsA("Model")) and (v.Name == "Plane") and (v:findFirstChild("acesTag")) then
local newPlaneID_BillboardGui,newPlaneID_ImageLabel = Instance.new("BillboardGui"),Instance.new("ImageLabel")
newPlaneID_BillboardGui.Parent = v:findFirstChild("acesTag")
newPlaneID_ImageLabel.Parent = newPlaneID_BillboardGui
newPlaneID_BillboardGui.Adornee = v:findFirstChild("acesTag")
newPlaneID_BillboardGui.Size = {10,0},{10,0}
newPlaneID_ImageLabel.Size = {1,0},{1,0}
newPlaneID_ImageLabel.Image = enemyMarker
end
elseif (v:IsA("Model")) and (v:findFirstChild("Humanoid")) then
if (v:IsA("Model")) and (v.Name == "Plane") and (v:findFirstChild("strikersTag")) then
local newPlaneID_BillboardGui,newPlaneID_ImageLabel = Instance.new("BillboardGui"),Instance.new("ImageLabel")
newPlaneID_BillboardGui.Parent = v:findFirstChild("strikersTag")
newPlaneID_ImageLabel.Parent = newPlaneID_BillboardGui
newPlaneID_BillboardGui.Adornee = v:findFirstChild("strikersTag")
newPlaneID_BillboardGui.Size = {10,0},{10,0}
newPlaneID_ImageLabbel.Size = {1,0},{1,0}
newPlaneID_ImageLabel.Image = friendlyMarker
end
end
findPlanes(v)
end
end
end)
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
15 Apr 2012 08:18 PM
I notice the spelling mistake in ImageLabel down toward the bottom. Ignore it.
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
15 Apr 2012 08:19 PM
Code is also in a LocalScript, and the localscript is in StarterPack
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
16 Apr 2012 06:37 AM
Bump
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
16 Apr 2012 03:04 PM
Bump. :\
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