|
| 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 |
|
|
|
| 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 |
|
|
|
| 13 Oct 2013 07:56 AM |
| Thanks, I'll test that as soon as I get a chance. |
|
|
| Report Abuse |
|
|