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
 

Referencing things to names.

Previous Thread :: Next Thread 
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
13 Oct 2013 07:52 AM
I'm trying to make it so when you equip the gun it checks in Workspace for a model named "[yourname]Dart" and if it doesn't exist, it inserts one, and any darts you shoot are placed into their.

I'm stuck on how to check whether it exists. Here is what I've got so far inside the Equipped function.

if game.Workspace.[Tool.Parent.Name}Dart == nil then
local dartlocation = Instance.new("Model")
dartlocation.Name = ""..Tool.Parent.Name.."Dart"
dartlocation.Parent = game.Workspace

Would that work?
Report Abuse
Oozlebachr is not online. Oozlebachr
Joined: 30 Aug 2009
Total Posts: 22223
13 Oct 2013 07:55 AM
if workspace:findFirstChild(Tool.Parent.Name.."Dart") == nil then
local dartlocation = Instance.new("Model",workspace)
dartlocation.Name = Tool.Parent.Name.."Dart"
end
Report Abuse
killajake25 is not online. killajake25
Joined: 31 Jan 2011
Total Posts: 1713
13 Oct 2013 07:56 AM
Thanks, I'll test that as soon as I get a chance.
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