xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:31 PM |
Im doing the "How to code your dragon" and the code is letter by letter the same. (Also the dragon models wing keeps falling off.)
Code:
local sp=script.Parent
local head=sp:WaitForChild("Head")
function breathefire() local fireball=Instance.new("Part") fireball.Name="Effect" fireball.BrickColor.new("Bright orange") fireball.Shape="Ball" fireball.Size=Vector3.new(2,2,2) fireball.CanCollide=false fireball.CFrame=head.CFrame fireball.Velocity=head.CFrame.lookVector*50 fireball.TopSurface="Smooth" fireball.BottomSurface="Smooth" fireball.Parent=game.Workspace end
while true do wait (2) breathefire() end
Error: new is not a valid member (Of instance I guess.) |
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 03 Jul 2014 07:38 PM |
When using instance, you should pass 2 arguments.
The first ("Part") is object type and the second is parent.
So:
local fireball = Instance.new("Part", game.Workspace) |
|
|
| Report Abuse |
|
|
xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:41 PM |
Thanks. :P Why did Luke's code work without that? New update? |
|
|
| Report Abuse |
|
|
xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:43 PM |
| Ok and now new is still "not a valid member", do I have to do this for every property? |
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 03 Jul 2014 07:43 PM |
| Not sure. I thought it was so that you had to set the parent separately too until recently. |
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 03 Jul 2014 07:43 PM |
| Hmm if that's not working then remove the local from in front of everything and see if that works |
|
|
| Report Abuse |
|
|
xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:46 PM |
| Still refuses to do anything. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:46 PM |
fireball.BrickColor.new("Bright orange")
Nope.
fireball.BrickColor = BrickColor.new("Bright orange") |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:47 PM |
| @Typocrite: Just so you know, argument 2 of Instance.new is an optional argument, and in some cases it may be best to not use it (At least, not immediately) |
|
|
| Report Abuse |
|
|
Typocrite
|
  |
| Joined: 28 Aug 2013 |
| Total Posts: 6856 |
|
|
| 03 Jul 2014 07:48 PM |
Odd, since I've been using instance a lot recently.
Here's an instance script that is working for me right now..
Title = Instance.new("BillboardGui", char.Head) Title.Adornee = char.Head Title.Size = UDim2.new(3,0,1,0) Title.StudsOffset = Vector3.new(0,2,0) TextLabel = Instance.new("TextLabel", char.Head.BillboardGui) TextLabel.Size = UDim2.new(1,0,1,0) TextLabel.TextColor3 = Color3.new(0,0,255) TextLabel.BackgroundTransparency = 1 TextLabel.TextStrokeTransparency = 0 TextLabel.Font = "SourceSans" TextLabel.FontSize = "Size48" TextLabel.Text = "Creator"
Check and see if there are any differences (other than that I made GUIs with different defined properties) |
|
|
| Report Abuse |
|
|
xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:48 PM |
| @Not -- Works now, guess they changed it since that video. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 07:49 PM |
| No, always like that. You might have just mis-read it. Or whoever made it made a mistake. |
|
|
| Report Abuse |
|
|
xender2
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 1970 |
|
|
| 03 Jul 2014 07:50 PM |
Just watch the "How to code your dragon" video by luke.
(Added the "local's" back, still work.) |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 08:04 PM |
Then he did it wrong.
You CANNOT do Object.Property.new |
|
|
| Report Abuse |
|
|
| |
|