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 Simple Script Help

Previous Thread :: Next Thread 
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
13 Dec 2013 04:26 AM
Just wanted to ask if anyone could help by fixing this script for me.

Pos = script.Parent.Position
while true do
wait(1)
Pos.X = Pos.X + 5
end

thank you.
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
13 Dec 2013 04:42 AM
p = script.Parent
while wait(1) do
p.Position.X = p.Position.X + 5
end
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
13 Dec 2013 04:47 AM
@KiwiMeister

I get this in the output.
13:46:55.028 - X cannot be assigned to
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
13 Dec 2013 04:53 AM
p = script.Parent
while wait(1) do
p.Position = Vector3.new(p.Position + 1,0,0)
end
Try this.
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
13 Dec 2013 07:58 AM
@KiwiMeister

16:58:39.528 - Workspace.Part.lol:3: bad argument #2 to '?' (Vector3 expected, got number)
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
13 Dec 2013 09:00 AM
I'll give it a shot I guess..

p = script.Parent
while wait(1) do
p.CFrame = P.CFrame + Vector3.new(0, 0, 0) --Change the Vector3 to what ever direction you want it to go..
end
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
13 Dec 2013 09:03 AM
your all wrong :D

p = script.Parent
while wait(1)do
p.Position = P.Position + Vector3.new(5, 0, 0)
end

or this

p = script.Parent
while wait(1)do
p.CFrame = P.CFrame + CFrame.new(5, 0, 0)
end
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
13 Dec 2013 09:05 AM
@Brink, actually mine is also correct.

Unless I made some sort of nonexistence error since I wrote it in the reply.
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
13 Dec 2013 09:06 AM
ah i didnt see your script yeah that one should work to
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
13 Dec 2013 09:08 AM
>>>>

p = script.Parent
while wait(1)do
p.CFrame = P.CFrame + CFrame.new(5, 0, 0)
end


>>>>

Two errors in it:

10:07:03.319 - Workspace.Part.Script:3: attempt to index global 'P' (a nil value)

10:07:20.662 - Workspace.Part.Script:3: bad argument #2 to '?' (Vector3 expected, got userdata)
Report Abuse
iLiminate is not online. iLiminate
Joined: 26 Feb 2012
Total Posts: 388
13 Dec 2013 10:29 AM
You could simply do this:


p = script.Parent
while wait(1) do
p.Position = Vector3.new(p.Position.X + 1,0,0)
end
Report Abuse
iLiminate is not online. iLiminate
Joined: 26 Feb 2012
Total Posts: 388
13 Dec 2013 10:31 AM
My bad, not trying to double post but heres it fixed:

p = script.Parent
while wait(1) do
p.CFrame = Vector3.new(p.Position.X + 5,0,0)
end
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
13 Dec 2013 11:46 AM
@iLiminate

LOL nope!

Your script errors.

12:45:21.086 - Workspace.Part.Script:3: bad argument #3 to 'CFrame' (CFrame expected, got userdata)
Report Abuse
iLiminate is not online. iLiminate
Joined: 26 Feb 2012
Total Posts: 388
13 Dec 2013 12:23 PM
Whelp, here it is fixed:


p = script.Parent
while wait(1) do
p.CFrame = Vector3.new(p.CFrame.X + 5,0,0)
end


if CFrame.X doesn't work try
CFrame.x
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