enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 01:26 AM |
I made a script where you click and you move to spot but it only works with studio why is that and what can I do to change?
function move() char.Humanoid:MoveTo(Mouse.Hit.p, Workspace.Baseplate) script.Parent.Busy.Value = false wait() end
Mouse.Button1Down:connect(move)
|
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 01:40 AM |
"only works with studio"? Any output? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 01:47 AM |
It looks as if you are using GetMouse() to get the mouse by the look of things.
Did you define the Mouse and all the variables?
If you are using GetMouse(), make sure you are using a LocalScript. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 09:44 AM |
| Yeah its in a local script and everything. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 09:46 AM |
local Player = Game.Players.LocalPlayer local Mouse = Player:GetMouse() |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 10:18 AM |
| That's what I got in localscript |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
| |
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
| |
|
|
| 28 Aug 2013 12:04 PM |
| Why do you even need a script to move the player to where they click? |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 28 Aug 2013 12:06 PM |
@HumanXerxes, Because that's what ROBLOX used to have and it was Epic Sauce. (Used a lot in Obbys for Invisible path finding) |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 28 Aug 2013 12:06 PM |
@Human It's called "innovative"
@Enyahs Is it in starterpack/startergui? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 12:07 PM |
| Omg Ive been using MouseLockSwitch so long I didn't even notice the green circle doesn't appear anymore?! Now I understand :P |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 28 Aug 2013 12:10 PM |
| Yeah I don't know why they haven't just removed classic mode altogether. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 12:10 PM |
| Its in StarterGui it gets the mouse and works fine in studio and I just want the target to move where I clicked it doesn't need to show the green circle but it did in studio and im a little confused why it doesn't work in regular games. |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 28 Aug 2013 12:13 PM |
| Try targeting the parent player instead of LocalPlayer, maybe? I don't really know but might as well try it |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 12:21 PM |
| You cannot use a regular script to grab a players mouse it must be local script. |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 28 Aug 2013 12:22 PM |
| It would still be in the localscript, just instead of LocalPlayer. |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 28 Aug 2013 12:41 PM |
I attempted to make my own version of this:
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local char = player.Character
local Part = Instance.new("Part", char) Part.FormFactor = "Custom" Part.Size = Vector3.new(2, 0.2, 2) Part.Anchored = true Part.CanCollide = false Part.Locked = true Part.BrickColor = BrickColor.new("Lime green") local Mesh = Instance.new("CylinderMesh", Part)
Mouse.Button1Down:connect(function () if (Mouse.Hit.p - char.Torso.Position).magnitude <= 50 then char.Humanoid:MoveTo(Mouse.Hit.p) -- Line 16 wait() end end)
while true do wait() if (Mouse.Hit.p - char.Torso.Position).magnitude <= 50 then Part.Transparency = 0 Part.CFrame = CFrame.new(Mouse.Hit.p) else Part.Transparency = 0 end end
It did not work, I got an error from Output saying:
game.Players.Player1.PlayerGui.LocalScript.Line 16; Argument 2 missing. |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 28 Aug 2013 12:42 PM |
That should be:
else Part.Transparency = 1 |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
| |
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 28 Aug 2013 12:45 PM |
| char.Humanoid:MoveTo(Mouse.Hit.p, --[[the disk thing]]) -- Line 16 |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 12:51 PM |
| Im not trying to recreate the green circle I just want the localplayer who clicked to go into the position I clicked. |
|
|
| Report Abuse |
|
|
mark298
|
  |
| Joined: 24 Oct 2008 |
| Total Posts: 1264 |
|
|
| 28 Aug 2013 12:54 PM |
@janthran, Yeah, I got that, I'm just completely zoned out today... |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 28 Aug 2013 01:10 PM |
| Again do we need to use a ball or part to do this? I don't think so lol |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
| |
|