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
 

Need help beaming up Scotty.

Previous Thread :: Next Thread 
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
26 Dec 2012 11:43 PM
So I have this huge, uncollidable cylinder that I'm trying to get to pull the user upwards when they touch it.

Velocity isn't working, and I want to use bodypositions as a last resort.

Any ideas?
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
27 Dec 2012 12:10 AM
Okay, so I culminated this. It's messy, but will it work?


function indexiveMass(targ)
local m = 0
local c = node:GetChildren()
for i = 1,#c do
if c[i].className == "Part" then
m = m + c[i]:GetMass()
end
m = m + indexiveMass(c[i])
end
return m
end

function pullPlayer(hit)
hume = game.Players:findFirstChild(hit.Parent.Name)
if hume and not hume.Character.Torso:findFirstChild("RisingForce") then

local pullforce = Instance.new("BodyForce")
pullforce.Name == "RisingForce"
pullforce.force = Vector3.new(0, indexiveMass(hit.Parent)*198.6, 0) --OVERCOMING GRAVITEEEEE
pullforce.Parent = hit.Parent["Torso"]
wait()
end
end

function removeForce(hit)
hume = game.Players:findFirstChild(hit.Parent.Name)
if hume and hume.Character.Torso:findFirstChild("RisingForce") then
hume.Character.Torso.RisingForce:destroy()
end
end

script.Parent.Touched:connect(pullPlayer)
script.Parent.TouchEnded:connect(removeForce)

Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
27 Dec 2012 12:19 AM
Okay, so that worked perfectly.

Thanks, SH, you've once again solved my problems through divine ignorance.
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