|
| 24 Sep 2014 07:00 AM |
No errors in SOLO/Online or Server local Player = game.Players.LocalPlayer repeat wait() until Player.Character ~= nil local Player = game.Players.LocalPlayer local Char = game.Players.LocalPlayer.Character local mouse = Player:GetMouse() local Camera = game.Workspace.CurrentCamera local Store = game:GetService("ServerStorage") local MouseHover = Store:WaitForChild("Mousehover") local H = MouseHover:Clone() H.Parent = Camera local click = 0
mouse.Move:connect(function() print(click) if mouse.Target == nil then print'Target is nil' return elseif click == 0 then print'Target is not nil' H.Position = mouse.Target.Position end end)
mouse.Button1Down:connect(function() print(click) click = 1 Char:WaitForChild("Humanoid") Char.Humanoid:MoveTo(H.Position,H) end)
H.Touched:connect(function() if click == 1 then print(click) click = 0 end end)
Char:WaitForChild("Humanoid").Died:connect(function() H:Destroy() end)
|
|
|
| Report Abuse |
|
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 24 Sep 2014 04:34 PM |
First - make sure it's in a localscript Second - add wait(2) before everything Thrid - why define Player twice and not even use it properly? |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:17 PM |
repeat wait() until game.Players.LocalPlayer.Character ~= nil local Player = game.Players.LocalPlayer local Char = game.Players.LocalPlayer.Character local mouse = Player:GetMouse() local Camera = game.Workspace.CurrentCamera local Store = game:GetService("ServerStorage") local MouseHover = Store:WaitForChild("Mousehover") local H = MouseHover:Clone() H.Parent = Camera local click = 0
wait(2) mouse.Move:connect(function() if mouse.Target == nil then return elseif click == 0 then H.Position = mouse.Target.Position end end) wait(2) mouse.Button1Down:connect(function() click = 1 Char:WaitForChild("Humanoid") Char.Humanoid:MoveTo(H.Position,H) end) wait(2) H.Touched:connect(function() if click == 1 then click = 0 end end) wait(2) Char:WaitForChild("Humanoid").Died:connect(function() H:Destroy() end) |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:21 PM |
wait(2) -- no
it works better in solo because solo runs on the client's machine, not through the Roblox Servers
Use a repeat method
repeat wait() until InsertCodeHereThatMakesitCheckifTrue
Example:
while wait(2) do i = 1 v = i + 1 print(i)
repeat wait() until i = 10 break end |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:27 PM |
I'm quite sorry, can you help me put it together, If you can, or don't mind. <3 |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:28 PM |
| <3 You play Basewars I've got 53k kills 5k deaths |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:33 PM |
"Add wait(2)"
lmao
wait() would do the trick just fine |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2014 06:34 PM |
nah
wait(2) is bad
wait(3) is better
or repeat wait() |
|
|
| Report Abuse |
|
|