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 » Scripters
Home Search
 

Re: *PRO SCRIPTERS READ* NEED HELP PLS

Previous Thread :: Next Thread 
BrickUser is not online. BrickUser
Joined: 19 Dec 2011
Total Posts: 21266
13 Jan 2015 03:03 PM
I want to make the character move when he has no gravity.

local bin = script.Parent

local equalizingForce = 800 / 1.2
local gravity = .5

function animate(torso)
local m = torso:FindFirstChild("Right Shoulder")
if m ~= nil then
m.C0 = CFrame.fromEulerAnglesXYZ(0, -1.57, 3.14) + Vector3.new(-1, -0.5, 0)
end
m = torso:FindFirstChild("Left Shoulder")
if m ~= nil then
m.C0 = CFrame.fromEulerAnglesXYZ(0, -4.71, 3.14) + Vector3.new(1, -0.5, 0)
end
m = torso:FindFirstChild("Left Hip")
if m ~= nil then
m.C0 = CFrame.fromEulerAnglesXYZ(0, -1.57, 3.14) + Vector3.new(-1, 1, 0)
end
m = torso:FindFirstChild("Right Hip")
if m ~= nil then
m.C0 = CFrame.fromEulerAnglesXYZ(0, -4.71, 3.14) + Vector3.new(1, 1, 0)
end
end

local debound = false

function recursiveGetMass(node)
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 + recursiveGetMass(c[i])
end
return m
end

function onHit(hit)
if hit.Parent ~= nil then
local human = hit.Parent:FindFirstChild("Humanoid")
if human ~= nil and debound == false then
debound = true
bin.BrickColor = BrickColor.new(21)
bin.Size = Vector3.new(2, .4, 2)
bin.CFrame = bin.Parent.Stand.CFrame + Vector3.new(0, .2, 0)
local torso = hit.Parent:FindFirstChild("Torso")
local head = hit.Parent:FindFirstChild("Head")
if torso ~= nil and head ~= nil then
local weld = torso:FindFirstChild("Neck")
if weld ~= nil then
weld.C0 = CFrame.fromEulerAnglesXYZ(1.57, 0, 0) + Vector3.new(0, -1, 0)
animate(torso, head)
local bf = Instance.new("BodyForce")
bf.Parent = torso
bf.force = Vector3.new(0, recursiveGetMass(hit.Parent) * equalizingForce * gravity, 0)
bf.Name = "Gravity"
local gyro = Instance.new("BodyGyro")
gyro.cframe = CFrame.new(1, 0, 1)
gyro.maxTorque = Vector3.new(4e+005, 0, 4e+005)
gyro.Parent = torso
local gp = script.Gamepad:clone()
gp.Disabled = false
gp.Parent = hit.Parent
end
end
wait(3)
debound = false
bin.BrickColor = BrickColor.new(28)
bin.Size = Vector3.new(2, .8, 2)
bin.CFrame = bin.Parent.Stand.CFrame + Vector3.new(0, .4, 0)
end
end
end

bin.Touched:connect(onHit)
Report Abuse
BrickUser is not online. BrickUser
Joined: 19 Dec 2011
Total Posts: 21266
13 Jan 2015 03:06 PM
I don't want the player to not move, I want the player to move instead.
Report Abuse
BrickUser is not online. BrickUser
Joined: 19 Dec 2011
Total Posts: 21266
13 Jan 2015 03:09 PM
):
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
13 Jan 2015 03:23 PM
Don't underestimate the average scripter, they go through a lot more problems scripting then you may think.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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