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: Error with script

Previous Thread :: Next Thread 
namejoe is not online. namejoe
Joined: 01 Dec 2010
Total Posts: 137
08 Nov 2013 03:21 PM
script 1 =

number = 1
function onButtonClicked(hit)

model = game.Lighting.Model
lol = script.Parent.Parent.Parent.Parent.Name

anothermodel = model:clone()
anothermodel.Parent = workspace
anothermodel.Name = number
number = number + 1
anothermodel:MakeJoints()


end
script.Parent.MouseButton1Down:connect(onButtonClicked)


script 2 =

Car = game.Workspace

function onButtonClicked(hit)

player = number



Workspace.player.Head.RocketPropulsion.Target = script.Parent.Parent.Parent.Parent.Character.Head
Workspace.nplayer.Head.RocketPropulsion:fire()

end
script.Parent.MouseButton1Down:connect(onButtonClicked)


when i click the gui with script 2, nothing happens!!! it
is supposted to make the block with the number move at me!

Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
08 Nov 2013 03:24 PM
you are using workspace.player and workspace.nplayer.
Spelling error? Is this an NPC?

Also number is undefined in the second script.
Report Abuse
namejoe is not online. namejoe
Joined: 01 Dec 2010
Total Posts: 137
08 Nov 2013 03:27 PM
how do i define number as the current value of the first script number

it is supposted to follow you
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
08 Nov 2013 03:29 PM
Use

_G.Number instead of Number. It will make it accessible. If they are bot the same type of script.
Report Abuse
namejoe is not online. namejoe
Joined: 01 Dec 2010
Total Posts: 137
08 Nov 2013 03:35 PM
now my script is


Car = game.Workspace

function onButtonClicked(hit)

player = G.number



Workspace.player.Head.RocketPropulsion.Target = script.Parent.Parent.Parent.Parent.Character.Head
Workspace.player.Head.RocketPropulsion:fire()

end
script.Parent.MouseButton1Down:connect(onButtonClicked)

still not follwoing
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
08 Nov 2013 03:38 PM
_G.Number not G.Number

And you have to put _G.Number in the first script too.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
08 Nov 2013 03:39 PM
Also do you have the hierarchy right for getting the player?
Report Abuse
namejoe is not online. namejoe
Joined: 01 Dec 2010
Total Posts: 137
08 Nov 2013 03:41 PM
i have a test for a model

wothout creation it owrks

i will try
Report Abuse
namejoe is not online. namejoe
Joined: 01 Dec 2010
Total Posts: 137
08 Nov 2013 03:43 PM
still not working
it wont come
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