of     1   

blox6137
#141136935Tuesday, July 22, 2014 4:48 AM GMT

I have this script, that moves a model by clicking, but now it wont stop moving the model to where I click. ~~~~~ local littleSoldier = script.Parent local click1 = Instance.new("ClickDetector") click1.Parent = littleSoldier local hum = script.Parent.Parent:FindFirstChild("Humanoid") click1.MouseClick:connect(function(click) local player = click local click2 = player:GetMouse() click2.Button1Down:connect(function(mouse) hum:MoveTo(click2.hit.p) end) end) ~~~~~
blox6137
#141137967Tuesday, July 22, 2014 5:03 AM GMT

:/ Bump.
UncleTaz
#141138561Tuesday, July 22, 2014 5:12 AM GMT

xpcall (But I'm not experienced with that) Or you can use a conditional statement.
128GB
#141138598Tuesday, July 22, 2014 5:13 AM GMT

Your script isn't going to work outside of studio you know, local scripts only run inside the player or the backpack/playergui Or is your solider inside the player?
UncleTaz
#141138655Tuesday, July 22, 2014 5:13 AM GMT

:o I have a idea but I'm going take a shower I'll share after this D:
128GB
#141138669Tuesday, July 22, 2014 5:14 AM GMT

@Uncle local littleSoldier = script.Parent local click1 = Instance.new("ClickDetector") click1.Parent = littleSoldier local hum = script.Parent.Parent:FindFirstChild("Humanoid") click1.MouseClick:connect(function(click) local player = click local click2 = player:GetMouse() click2.Button1Down:wait() hum:MoveTo(click2.hit.p) end) Would be the way to fix it, although like I said, only for studio
blox6137
#141138706Tuesday, July 22, 2014 5:14 AM GMT

O_O... It's not inside the player... Yeah, I found out it doesn't work around 10 minutes ago...
128GB
#141138943Tuesday, July 22, 2014 5:18 AM GMT

Do you still want it fixed?
blox6137
#141139201Tuesday, July 22, 2014 5:21 AM GMT

I'd be most appreciative, but... How does one determine if a script is local or not? Does it matter where it is placed, or...? Because I made a version of the script that was a child of the Workspace, but it still doesn't work in-game...
128GB
#141139373Tuesday, July 22, 2014 5:24 AM GMT

Local script are the ones from Instance.new("LocalScript", Workspace) Server scripts are Instance.new("Script", Workspace) In studio mode all scripts are ran as local, even server scripts, because your studio IS the server and the cleint
blox6137
#141139694Tuesday, July 22, 2014 5:29 AM GMT

So I inserted a "server script" by instancing a new one, I then pasted the script in that server script, and placed it where the old one was after I deleted it... Still not working. Am I missing something?
128GB
#141139741Tuesday, July 22, 2014 5:30 AM GMT

The players mouse can _not_ be used by a server script
blox6137
#141139931Tuesday, July 22, 2014 5:33 AM GMT

I see.
128GB
#141140027Tuesday, July 22, 2014 5:34 AM GMT

I would suggest putting the click detector already in the object, and the local script in the startergui It'd need to be rewriten, I can do that or you can try and I'll help fix it
128GB
#141140071Tuesday, July 22, 2014 5:35 AM GMT

'It'd need to be rewriten, I can do that or you can try and I'll help fix it' I'm sorry that was very rude I'll help fix it if it does not work, I wasn't trying to say you can't do it.
blox6137
#141140382Tuesday, July 22, 2014 5:39 AM GMT

Don't worry about it, I understood what you meant lol. I'll work on a new script, and just post in the forums when I need help. I don't want to be a burden.
blox6137
#141141204Tuesday, July 22, 2014 5:51 AM GMT

I made the new script, and it works! Thanks for all the help!
UncleTaz
#141141400Tuesday, July 22, 2014 5:54 AM GMT

I wish I didn't go take a shower D: Can I test?
blox6137
#141142090Tuesday, July 22, 2014 6:04 AM GMT

I have the two soldiers I made at the game... I'll make my place copy-able so you could copy it and check it out...

    of     1