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: Very stuck with some code.

Previous Thread :: Next Thread 
xender2 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. xender2
Joined: 30 Aug 2009
Total Posts: 1970
03 Jul 2014 07:46 PM
Still refuses to do anything.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2014 07:46 PM
fireball.BrickColor.new("Bright orange")

Nope.

fireball.BrickColor = BrickColor.new("Bright orange")
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. 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 is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2014 08:04 PM
Then he did it wrong.

You CANNOT do Object.Property.new
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jul 2014 08:05 PM
What is the new error?
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