of     1   

Cr0ws
#140604752Thursday, July 17, 2014 5:52 AM GMT

This may be a big chunk to do,but mainly Im simply trying to make my pig walk to different locations while welded together,if you cannot resolve the script I put out,do you have any other methods I could choose? Error:The pig won't move(at all) ---------------------------------Weld Script function weld() local parts,last = {} local function scan(parent) for _,v in pairs(parent:GetChildren()) do if (v:IsA("BasePart")) then if (last) then local w = Instance.new("Weld") w.Name = ("%s_Weld"):format(v.Name) w.Part0,w.Part1 = last,v w.C0 = last.CFrame:inverse() w.C1 = v.CFrame:inverse() w.Parent = last end last = v table.insert(parts,v) end scan(v) end end scan(script.Parent) for _,v in pairs(parts) do v.Anchored = false end end weld() script:Remove() ----------------------------------CFrame Script pig = script.Parent function Walking() torso = pig.Torso torso.CFrame = CFrame+Vector3.new(math.random(1,6),0,math.random(1,6)) while true do print(torso.CFrame) wait(.5) end end function Alarmed() pig.Torso.Touched:connect(function(hit) if hit.Name == "Damager" then pig.Alarmed.Value = true wait(10) end end) pig.Alarmed.Value = true end while true do Walking() wait(1) end __________________________________________________________________________
Cr0ws
#140606092Thursday, July 17, 2014 6:07 AM GMT

Ill try to keep this thread alive until I find resolution /imthatdesperate
Cr0ws
#140672226Thursday, July 17, 2014 10:34 PM GMT

/reboot
MusicalGamer365
#140680302Friday, July 18, 2014 12:02 AM GMT

Based on what you are trying to do, I'm guessing this is for a Minecraft game. First off, make sure no parts of the pig are anchored. That can screw things up. Second, make sure that when the weld script runs, it isnt welding to a part other than in the pig. Then for the walking, you will want to use this instead: pig = script.Parent alarm = pig.Alarmed h = pig.Humanoid --you'll see why I do this later torso = pig.Torso function Walk() --[[MoveTo will make the pig actually walk its way to the point rather than teleport and can only be used on the Humanoid]]-- h:MoveTo(torso.Position+Vector3.new( math.random(-6,6),math.random(-6,6),math.random(-6,6)) --the negatives are to ensure its truly random rather than always going in one range of directions. end --having function Alarmed here is pointless and will make the function below not trigger. torso.Touched:connect(function(hit) if hit.Name == "Damager" then alarm.Value = true wait(10) alarm.Value = false --by the way if you want the pig to run around during this state, it would be wise to do it in another script which makes the pig's walkspeed x2 and same as walk but resets later. end end) while wait(1) do --less typing if you do it like this Walk() end hope this helps.
Cr0ws
#140685395Friday, July 18, 2014 12:53 AM GMT

thanks so much and by the way its for a beautifully built game called Medieval Scape coming soon
MusicalGamer365
#142155411Thursday, July 31, 2014 5:38 AM GMT

Glad I could help. I'll check it out when its done.

    of     1