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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
25 Feb 2015 06:02 PM
[ Content Deleted ]
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
25 Feb 2015 06:06 PM
[ Content Deleted ]
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
25 Feb 2015 06:13 PM
[ Content Deleted ]
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
25 Feb 2015 06:25 PM
[ Content Deleted ]
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
25 Feb 2015 06:27 PM
"Ok so i know how to use pathfinding to make an npc move but,"

I believe it should already move already.
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
25 Feb 2015 06:29 PM
[ Content Deleted ]
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
25 Feb 2015 06:32 PM
Play a legacy animation or something
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
25 Feb 2015 06:59 PM
There is a script inside many NPS. called either Robot, Walk, or Animate, which moves his arms and legs.

Here is one from Speed AI, called AnimateAny (It animates a Humanoid, no matter what the Humanoid Object is .Named:


function waitForChild(parent, childName)
while true do
local child = parent:findFirstChild(childName)
if child then
return child
end
parent.ChildAdded:wait()
end
end

-- declarations

local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")

local Humanoid = nil -- Hack to Animate a Humanoid, no mateer what Humanoid is .Named.
if true then
local list = Figure:GetChildren() -- temp var.
for x = 1, #list do
local temp = list[x]
if (temp.className == "Humanoid") then
Humanoid = temp.Name
end -- found Humanoid
end -- Parts
end -- Discard list
local Humanoid = Figure[Humanoid]

--local Humanoid = waitForChild(Figure, "Humanoid")

local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0

local isSeated = false

-- functions

function onRunning(speed)
if isSeated then return end

if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end

function onDied()
pose = "Dead"
end

function onJumping()
isSeated = false
pose = "Jumping"
end

function onClimbing()
pose = "Climbing"
end

function onGettingUp()
pose = "GettingUp"
end

function onFreeFall()
pose = "FreeFall"
end

function onFallingDown()
pose = "FallingDown"
end

function onSeated()
isSeated = true
pose = "Seated"
print("Seated")
end



function moveJump()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end

function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1
LeftShoulder.DesiredAngle = -1
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end


function moveClimb()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end

function moveSit()
print("Move Sit")
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = 3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end

function getTool()

kidTable = Figure:children()
if (kidTable ~= nil) then
numKids = #kidTable
for i=1,numKids do
if (kidTable[i].className == "Tool") then return kidTable[i] end
end
end

return nil
end

function getToolAnim(tool)

c = tool:children()
for i=1,#c do
if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
return c[i]
end
end
return nil
end

function animateTool()

if (toolAnim == "None") then
RightShoulder.DesiredAngle = 1.57
return
end

if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end

if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end

function move(time)
local amplitude
local frequency

if (pose == "Jumping") then
moveJump()
return
end

if (pose == "FreeFall") then
moveFreeFall()
return
end

if (pose == "Climbing") then
moveClimb()
return
end

if (pose == "Seated") then
moveSit()
return
end


RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
if (pose == "Running") then
amplitude = 1
frequency = 9
else
amplitude = 0.1
frequency = 1
end

desiredAngle = amplitude * math.sin(time*frequency)

RightShoulder.DesiredAngle = desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle


local tool = getTool()

if tool ~= nil then

animStringValueObject = getToolAnim(tool)

if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end

if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end

animateTool()


else
toolAnim = "None"
toolAnimTime = 0
end
end


-- connect events

Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)

-- main program

local nextTime = 0
local runService = game:service("RunService");

while Figure.Parent~=nil do
time = runService.Stepped:wait()
if time > nextTime then
move(time)
nextTime = time + .1
end
end
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