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: :(

Previous Thread :: Next Thread 
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:30 PM
whats wrong?

function onTouch(hit)
e = hit.Parent:GetMass()
x = e * 200
m = instance.new("BodyForce")
m.name = "hmm"
m.force = 0, x, 0
m.Parent = e
end

script.Parent.Touched:connect(OnTouch)
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
24 Oct 2010 04:31 PM
You can't GetMass of a model?
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:32 PM
not a model it's just a part
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
24 Oct 2010 04:32 PM
That, there's a lowercase "i" in Instance.new and your connection line (OnTouch) should be (onTouch).
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
24 Oct 2010 04:32 PM
That, there's a lowercase "i" in Instance.new and your connection line (OnTouch) should be (onTouch).
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
24 Oct 2010 04:36 PM
function onTouch(hit)
e = hit:GetMass()
x = e * 196.22
m = Instance.new("BodyForce")
m.Name = "hmm"
m.force = Vector3.new(0, x, 0)
m.Parent = hit
end

script.Parent.Touched:connect(onTouch)
Report Abuse
luigiman876 is not online. luigiman876
Joined: 22 Nov 2008
Total Posts: 1442
24 Oct 2010 04:37 PM
m's parent can't be mass.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:37 PM
now this is what i have got

function onTouch(hit)
e = hit:GetMass()
x = e * 200
m = Instance.new("BodyForce")
m.Name = "hmm"
m.force = 0, x, 0 <--- problem line
m.Parent = e
end

script.Parent.Touched:connect(onTouch)

the output is saying this :

Workspace.Part.Script:6: bad argument #3 to '?' (Vector3 expected, got number)
Workspace.Part.Script, line 6 stack end
Disconnected event because of exception
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
24 Oct 2010 04:38 PM
Use my script.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:39 PM
late post ahh
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:39 PM
awsome it works, thanks!
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:47 PM
now what is wrong with this?

function onTouch(hit)
if script.Parent.Value.Value == true then
hit.Ancored = true
wait()
hit.Ancored = false
else
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
24 Oct 2010 04:48 PM
You spelled "Anchored" wrong.


function onTouch(hit)
if script.Parent.Value.Value == true then
hit.Anchored = true
wait()
hit.Anchored = false
else
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 04:51 PM
thanks and another question, if you anchor something does it's velocity cancel out like if there is a weightless block thats moving then you anchor it work like a split second then unanchor it would it stop or keep going?
Report Abuse
hershysnickers is not online. hershysnickers
Joined: 22 Mar 2009
Total Posts: 919
24 Oct 2010 04:57 PM
Think of a ship. When it lets an anchor go, does it stop, or keep going?
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:00 PM
if there is a current it will start going or if it starts it's engines it will start going but if there is no current or it doesn't start it's engines it doesn't go.

whats this got to do with anything?
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:10 PM
hello?
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
24 Oct 2010 05:12 PM
When you anchor a brick, it's velocity stays but is "disabled". When you unanchor it the velocity is at the velocity it was before and is now "enabled" again.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:14 PM
so how would you turn the velocity to 0, 0, 0?
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
24 Oct 2010 05:15 PM
BRICK.Velocity = Vector3.new(0,0,0)


Fun Fact!
To get the "speed" of a brick:
speed = BRICK.Velocity.magnitude
print(speed)
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:20 PM
thanks, and 1 last thing, if there a way to round numbers from like 10703.4809384 to 10703?
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
24 Oct 2010 05:21 PM
function round(num)
return math.floor(num + 0.5)
end

round(1.0545327)
>1

round(2.6883)
>3
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:23 PM
umm sorry i don't really understand that :(
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 05:58 PM
bump
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
24 Oct 2010 06:05 PM
*insert humming of still alive from portal*
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