RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:10 PM |
I am planning to make a game, with an autowalk feature, where you click a GUI button and the player moves forward by itself.
Is this possible? If it is, how would you do it? |
|
|
| Report Abuse |
|
|
TrollBay
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 217 |
|
| |
|
|
| 08 Mar 2013 01:13 PM |
Do player.Humanoid:MoveTo(player.Torso.CFrame.lookVector*steps) With steps being the amount of steps forward, in studs. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 08 Mar 2013 01:13 PM |
<.< A troll indeed.
use the MoveTo method on the humanoid of a character, and make 'nodes' for them to walk to. |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:15 PM |
@Render
I don't want the player to stop.
He can't stop.
I want the player to walk without an end. |
|
|
| Report Abuse |
|
|
TrollBay
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 217 |
|
| |
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:16 PM |
Um, what's up with the filter?
And why are you dressed as me? |
|
|
| Report Abuse |
|
|
TrollBay
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 217 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 08 Mar 2013 01:18 PM |
| TrollBay, gtfo. We don't need trolling idiots like you here. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 01:18 PM |
Ooh, hm. Do this. local b = Instance.new("BodyVelocity",player.Torso) b.maxForce=Vector3.new(16,1,16) --Might need a boost to ~20? while wait() do b.velocity=player.Torso.CFrame.lookVector*16 --With 16 being the walking speed end
Only problem is if you turn, you will keep walking the same way for a little bit longer. And jumping might be a bit odd. |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:20 PM |
Thank you @ Render.
I'm going to check this out and see if I can edit it in any sort of way to satisfy my needs.
Just one more question, where does this script go?
In a tool?
In a player character? |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 01:21 PM |
| The script should be inserted into the Character, but you will need to define player = script.Parent before you use the snippet above. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 08 Mar 2013 01:21 PM |
| Talk about the ROBLOX filter being a fail <.< TrollBay, get out. No one likes people like you. You're not being helpful, You're just being a dumb moron. |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:28 PM |
@Render
Alright I did this.
I inserted the script into Workspace and edited like this:
wait(5)
local b = Instance.new("BodyVelocity",game.Workspace.Player1.Torso) b.maxForce=Vector3.new(16,1,16) --Might need a boost to ~20? while wait() do b.velocity=game.Workspace.Player1.Torso.CFrame.lookVector*16 --With 16 being the walking speed end
Output doesn't say anything at all, and the script isn't working.
Any suggestions? |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 08 Mar 2013 01:31 PM |
I also checked the Torso in the player and it has a BodyVelocity (Meaning the script is working correctly)
Somehow it's not making it move. |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
| |
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
| |
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
| |
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 08 Mar 2013 04:16 PM |
Hm, you could increase the force of the BodyVelocity?
If your character isn't going to get drawn by a mystic power over stones and trees, stumbling and hitting it's head into the ground, getting hunted by angry dogs, roll in a bush and continue to get drawn by the power of BodyVelocity, then I really don't know what's wrong.
Otherwise, you could loop an offset on :MoveTo? Hm, and force-equip a tool that will destroy itself in order to prevent moving with the cursor. Oh, and remove the HumanoidController in the ControllerService to 100% block movements. INSTA-WIN! MOVE CHARACTER!
- As, are you getting hyper? No, I'm just... what am I? |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 04:23 PM |
Use the MoveTo() method in the Humanoid. This method tells a humanoid to walk to a certain point and is how are characters already move so there will be no difference.
http://wiki.roblox.com/index.php/MoveTo_(Method)/humanoid |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 04:24 PM |
@BJJ
Though with that method, you would also have to specify a part.
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 08 Mar 2013 04:32 PM |
workspace.Terrain ^
- As, in-in-in-instaaaaaaaaa-cake! |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 04:32 PM |
@Knightmare
Which is not a difficult thing to do. The link I gave should give him all the information needed. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 04:45 PM |
I assumed it wasn't towards only one spot, and I thought it would be a little inconvenient. Though As brings up a good point with Terrain, I didn't know it extends BasePart.
¤ ¤ † K M <( •д• )> X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 08 Mar 2013 05:46 PM |
Ok, let's end this madnesshhh.
Ty for giving me a name, I will use it the r... oh, I've used it in all my ziggies D: -------------------------------------------------------------
LocalScript: -------------------------------------------------------------
function waitForChild(instance, name) if instance:FindFirstChild(name) then return instance:FindFirstChild(name) end repeat wait() until instance:FindFirstChild(name) return instance:FindFirstChild(name) end
function waitForProperty(instance, name) if instance[name] then return instance[name] end repeat wait() until instance[name] return instance[name] end
local plr = waitForProperty(game:service("Players"), "LocalPlayer") -- I tried to force-equip a tool. Didn't work well, crashed some corescripts 3: -- Meep, another comment line 8D I waz here D:
function clearControl() for _,c in pairs(game:service("ControllerService"):GetChildren()) do c:Destroy() end end
clearControl()
function instaMove(hum) coroutine.wrap(function() while true do if not hum then return end local pos = CFrame.new(0, 0, 0) if hum.Torso then pos = hum.Torso.CFrame end hum:MoveTo((pos + pos.lookVector * 200).p, waitForProperty(workspace, "Terrain")) wait(0.05) end end)() end
function instaChar(chr) while true do for _,c in pairs(chr:GetChildren()) do if c:IsA("Humanoid") then instaMove(c) end end chr.ChildAdded:wait() end end
plr.CharacterAdded:connect(function() instaChar(plr.Character) end) instaChar(waitForProperty(plr, "Character")) -------------------------------------------------------------
Sorry for removing the force-equip part 3: I tried both tool & hopperbin (you cannot force-equip hopperbins anymore, sadly... byebye AUTO green-dot-removal & mouse-icon-switcher)
- As, I'm not happy. I had to actually TEST this code before posting it here! |
|
|
| Report Abuse |
|
|