|
| 17 Apr 2015 01:05 AM |
| I am currently trying to make an exact copy of my players npc to add into my game. My main goal is to create some nice looking npcs to just walk around my boat dock and have a message on top of their head. Im sorry if this is the wrong forum to post this but im just trying to learn a little about npcs. If anyone can help me or give me some pointers that would be great thanks. |
|
|
| Report Abuse |
|
| |
|
| 20 Apr 2015 11:15 AM |
| Can you specify what "exactly" you want to know about them? |
|
|
| Report Abuse |
|
Atoshi
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 92 |
|
|
| 20 Apr 2015 11:24 AM |
How do you want it to move?
First 'Play Solo' and copy the head, right arm, right leg, left arm, left leg, humanoid and the animations then click stop and paste it. Then add this script:
local CurrentPart = nil local MaxInc = 20
function onTouched(hit) if hit.Parent == nil then return end
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid == nil then CurrentPart = hit end end
function waitForChild(parent, childName) local child = parent:findFirstChild(childName)
if child then return child end
while true do print(childName)
child = parent.ChildAdded:wait()
if child.Name==childName then return child end end end
local Figure = script.Parent local Humanoid = waitForChild(Figure, "Humanoid") local Torso = waitForChild(Figure, "Torso") local Left = waitForChild(Figure, "Left Leg") local Right = waitForChild(Figure, "Right Leg")
Humanoid.Jump = true
Left.Touched:connect(onTouched) Right.Touched:connect(onTouched)
while true do wait(math.random(2, 6))
if CurrentPart ~= nil then if math.random(1, 2) == 1 then Humanoid.Jump = true end
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart) end end |
|
|
| Report Abuse |
|
Atoshi
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 92 |
|
|
| 20 Apr 2015 11:25 AM |
| This isn't probably how you want it to move. But you can change it yourself. |
|
|
| Report Abuse |
|