Stithos
|
  |
| Joined: 09 Apr 2014 |
| Total Posts: 40 |
|
|
| 06 Apr 2015 12:52 AM |
I am trying to make a script where you click and your player faces the spot that you clicked, but does not move.
I couldn't find anything on the wiki or forums. I made something that kinda works, but it's really buggy and i'm sure there is a better way to do it
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 1 game.Players.LocalPlayer.Character.Humanoid.WalkToPoint = mouse.Hit.p wait(0.25) game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 game.Players.LocalPlayer.Character.Humanoid.WalkToPoint = game.Players.LocalPlayer.Character.Torso.Position
Any help is appriciated. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 12:59 AM |
local players = game:GetService('Players') local player = players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() local mouse = player:GetMouse() local UIS = game:GetService('UserInputService')
UIS.InputBegan:connect(function(inputObject, gameProcessedEvent) if not gameProcessedEvent then if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then if mouse.Hit then character.Humanoid:MoveTo(mouse.Hit.p) end end end end) |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:00 AM |
Oh
You said not move.
That changes a few things. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 06 Apr 2015 01:01 AM |
player.Character:WaitForChild("Torso").CFrame = CFrame.new(player.Character.Torso.Position,Vector3.new(mouse.hit.p.X,player.Character.Torso.Position.Y,mouse.hit.p.Z))
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
Stithos
|
  |
| Joined: 09 Apr 2014 |
| Total Posts: 40 |
|
| |
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:07 AM |
--inspired by chimmihc
local players = game:GetService('Players') local player = players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() local mouse = player:GetMouse() local UIS = game:GetService('UserInputService')
UIS.InputBegan:connect(function(inputObject, gameProcessedEvent) if not gameProcessedEvent then if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then if mouse.Hit then character.Torso.CFrame = CFrame.new(player.Character.Torso.Position, mouse.Hit.p) end end end end) |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 06 Apr 2015 01:09 AM |
@amanda
You need to strip the Y axis or you can make your character facing down.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:13 AM |
| i type faster than i read :( |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:16 AM |
local players = game:GetService('Players') local player = players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() local mouse = player:GetMouse() local UIS = game:GetService('UserInputService')
print(mouse.Hit.p)
UIS.InputBegan:connect(function(inputObject, gameProcessedEvent) if not gameProcessedEvent then if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then if mouse.Hit then local hit = mouse.Hit local torso = character.Torso torso.CFrame = CFrame.new(torso.Position, Vector3.new(hit.X, torso.Position.Y, hit.Z)) end end end end) |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:20 AM |
how my script progressed:
1. teleportation 2. walking to destination 3. swimming in the air 4. actually doing what it was suppose to do
didn't post teleportation because i figured it out early on |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 06 Apr 2015 01:47 AM |
people like this
i really don't mind helping at all
people who are in it for a purpose, who want to get somewhere, who try
skill level doesn't matter
op is way above any guy who comes in here without trying to script and tries to bribe us into scripting something for them
which happens a lot more often then people who are polite and are trying to make something original and interesting |
|
|
| Report Abuse |
|
|