Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 09 Dec 2016 09:39 PM |
function onTouch(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") humanoid.WalkToPoint = Vector3.new(-150.5, 7, -109) local gui = game.Players.LocalPlayer.PlayerGui.Hint gui.Frame.Visible = true gui.Frame.TextLabel.Text = "Wait, where is the color?" wait(2) gui.Frame.TextLabel.Text = hit.Parent.Name .. ", you must help!" end
Doesn't have the player walk and doesn't have the gui pop up
#1 Poopposter on ATR |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37141 |
|
|
| 09 Dec 2016 09:44 PM |
See kids this is what happens when you grab a free models' script.
I have a spider on my back. |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 09 Dec 2016 09:46 PM |
It's not a free modeled script, I'm just new to scripting.
#1 Poopposter on ATR |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
| |
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 09 Dec 2016 10:22 PM |
Eww don't use WalkToPoint, use :MoveTo() instead.
Also, game.Players.LocalPlayer is specifically client-sided (as the wiki clearly states).
And it doesn't appear you're actually calling the function so I'm just assuming you did
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
v_3
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 16 |
|
|
| 09 Dec 2016 10:31 PM |
-- Free models are great for learning, but you should do some research yourself too. -- The action never gets triggered or connects. -- Heres the fix:
function onTouch(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") humanoid.WalkToPoint = Vector3.new(-150.5, 7, -109) local gui = game.Players.LocalPlayer.PlayerGui.Hint gui.Frame.Visible = true gui.Frame.TextLabel.Text = "Wait, where is the color?" wait(2) gui.Frame.TextLabel.Text = hit.Parent.Name .. ", you must help!" end
script.Parent.Touched:connect(onTouch)
-- Or better yet...
--[[--
script.Parent.Touched:connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") humanoid.WalkToPoint = Vector3.new(-150.5, 7, -109) local gui = game.Players.LocalPlayer.PlayerGui.Hint gui.Frame.Visible = true gui.Frame.TextLabel.Text = "Wait, where is the color?" wait(2) gui.Frame.TextLabel.Text = hit.Parent.Name .. ", you must help!" end)
--]]--
"Life is nothing more than code that wrote itself over time." |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 09 Dec 2016 11:42 PM |
I feel dumb.....
I know how to script, I just didn't realize I forgot to connect the function.
Also, if I use MoveTo() will that walk the player or teleport?
I want the player to walk to certain coordinates.
#1 Poopposter on ATR |
|
|
| Report Abuse |
|
|
| |
|
kaddad14
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 649 |
|
|
| 10 Dec 2016 01:26 AM |
| no, moveto teleports the object to the position chosen, theres no walking. Ignore these guys and just use WalkToPoint. |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 01:34 AM |
If there's an obstacle, I suggest adding pathfinding functionality. Here's some stuff to read into about this. http://wiki.roblox.com/index.php?title=Pathfinding
|
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 10 Dec 2016 10:37 AM |
There is no obstacle, and the WalkToPoint still isn't working.
Can someone help?
#1 Poopposter on ATR |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 10 Dec 2016 10:48 AM |
Use :MoveTo()
That guy obviously doesn't know what he's talking about. :MoveTo() on a humanoid just has the humanoid walk to the specified point.
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 10 Dec 2016 10:54 AM |
Yeah, don't even listen to @kaddad he's tripping. MoveTo() teleports a model, but if used on a humanoid it force walks it. |
|
|
| Report Abuse |
|
|
Eventive
|
  |
| Joined: 28 Jul 2011 |
| Total Posts: 9827 |
|
|
| 10 Dec 2016 11:17 AM |
So do I put the coordinates in the ()'s?
So if I change humanoid.WalkToPoint = Vector3.new(-150.5, 7, -109)
to
humanoid:MoveTo(-150.5, 7, -109)
would that be the correct way?
#1 Poopposter on ATR |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 10 Dec 2016 11:27 AM |
Why don't you test it or look it up on the wiki....
wiki.roblox.com
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 11:41 AM |
One way that always helps me and makes sure you don't forget to connect the function is to say something like this:
Mouse.Button1Down:connect(function() print("Wowzers") end)
instead of
function Wowzers() print("Wowzers") end
Mouse.Button1Down:connect(Wowzers) |
|
|
| Report Abuse |
|
|