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: Way to keep the script running if it fails

Previous Thread :: Next Thread 
shinx591 is not online. shinx591
Joined: 23 Sep 2013
Total Posts: 3
17 Mar 2017 03:42 PM
So, what I wished to do was to make an object interact with a player that touches it. To do so, I created a variable for each player that would be on one server (player1 - player12).

However, the script stops working whenever it fails to find a player.

Is there anyway around this error, or do I have to completely redo the script to make it work?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
17 Mar 2017 03:44 PM
No reason to create variables for players or anything like that,

What do you mean by "interact" ?


Report Abuse
shinx591 is not online. shinx591
Joined: 23 Sep 2013
Total Posts: 3
17 Mar 2017 03:58 PM
the object itself is supposed to teleport the nearest player.

It might be a problem with the function teleporting the player itself I'm not sure.

If needed I'll post the script.
Report Abuse
shinx591 is not online. shinx591
Joined: 23 Sep 2013
Total Posts: 3
20 Mar 2017 08:01 PM
Does anyone have a solution?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
21 Mar 2017 11:54 AM
local destination = Vector3.new(0,0,0) -- define this

script.Parent.Touched:connect(function(hit)
local char = hit.Parent
local player = game.Players:GetPlayerFromCharacter(char)
if player then
char:MoveTo(detination)
end
end)


Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
21 Mar 2017 01:08 PM
if statements or protected calls
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