generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: HELP ASAP PLEASE SCRIPT WONT WORK

Previous Thread :: Next Thread 
Eventive is not online. 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 is not online. 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 is not online. 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 is not online. Eventive
Joined: 28 Jul 2011
Total Posts: 9827
09 Dec 2016 09:59 PM
b


#1 Poopposter on ATR
Report Abuse
caca50 is not online. 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 is not online. 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 is not online. 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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
10 Dec 2016 01:13 AM
will walk


Report Abuse
kaddad14 is not online. 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
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image