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 » Scripting Helpers
Home Search
 

How do you...

Previous Thread :: Next Thread 
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
10 Feb 2012 04:47 PM
Sorry if I'm requesting but I have no idea
1.How do you make a script that detects if a Humanoid is 5 studs within you?

2.How do you make a script that detects if you have a tool equipped?
So far this is what I got for this:
game.Workspace.Tool:connect(onEquipped) == false

Please help
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
10 Feb 2012 04:49 PM
http://wiki.roblox.com/index.php/Magnitude
http://wiki.roblox.com/index.php/Region3

have fun
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
10 Feb 2012 04:50 PM
Thanks again mage

-pointless siggy-
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
10 Feb 2012 04:52 PM
[1]
mag = (Workspace.Part1.Position - Workspace.Part2.Position).magnitude
if mag <= 5 and Workspace.Part2:findFirstChild("Humanoid") then
--code
end

[2]
if Tool.Enabled == true then
--code
end

Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
10 Feb 2012 04:55 PM
actually you could just make a 5/5/5 region around you, and if anything enters it with a humanoid then whatever.

you wouldn't need magnitude.
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
10 Feb 2012 05:16 PM
How exactly would you do that? Sorry I'm a bad scripter this is all I have:
local start_point = Vector3.new(1, 1, 1)
local end_point = Vector3.new(6, 6, 6)
Region3.new(
Vector3.new(
math.min(start_point.X, end_point.X),
math.min(start_point.Y, end_point.Y),
math.min(start_point.Z, end_point.Z)
),
Vector3.new(
math.max(start_point.X, end_point.X),
math.max(start_point.Y, end_point.Y),
math.max(start_point.Z, end_point.Z)
)
)

-pointless siggy-
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
10 Feb 2012 09:22 PM
Please excuse my last post @UFAIL2
For number 2 I'm getting this out of the output:

Workspace.Teleport Gui:5: unexpected symbol near 'if'

here is my whole script:

mag = (Workspace.TNTxERIC.Torso.Position - Script.Parent.Parent.Parent.Character.Torso.Position).magnitude
function Click()
if game.Workspace.TNTxERIC.Humanoid.Health == 100 and
game.Workspace.TNTxERIC.Humanoid.WalkSpeed == 16 and
if Tool.Enabled == false and
if mag <= 5 and Workspace.Part2:findFirstChild("Humanoid") then
game.Workspace.TNTxERIC:MoveTo(game.Workspace.Teleport.Position + Vector3.new(0,3,0))
end
end
end
end
script.Parent.MouseButton1Down:connect(Click)
Report Abuse
LevelNoobX is not online. LevelNoobX
Joined: 18 Sep 2011
Total Posts: 565
10 Feb 2012 09:59 PM
    mag = (Workspace.TNTxERIC.Torso.Position - Script.Parent.Parent.Parent.Character.Torso.Position).magnitude
    script.Parent.MouseButton1Down:connect(function()
    if game.Workspace.TNTxERIC.Humanoid.Health == 100 and
    game.Workspace.TNTxERIC.Humanoid.WalkSpeed == 16 and Tool.Enabled == false and
    mag <= 5 and Workspace.Part2:findFirstChild("Humanoid") then
    game.Workspace.TNTxERIC:MoveTo(game.Workspace.Teleport.Position + Vector3.new(0,3,0))
    end end)

It's not easy being cheesy. I love Marilyn Mason,Sucicide Silence, and IWABO. Baseplate Maker Plugin here: http://www.roblox.com/Baseplate-maker-plugin-item?id=71012144
Report Abuse
TNTxERIC is not online. TNTxERIC
Joined: 20 Nov 2010
Total Posts: 2689
10 Feb 2012 11:39 PM
@Level how do I make it so everyone teleports, not just me?

-pointless siggy-
Report Abuse
LevelNoobX is not online. LevelNoobX
Joined: 18 Sep 2011
Total Posts: 565
10 Feb 2012 11:54 PM
    mag = (Workspace.TNTxERIC.Torso.Position - Script.Parent.Parent.Parent.Character.Torso.Position).magnitude
    script.Parent.MouseButton1Down:connect(function()
    if game.Workspace.TNTxERIC.Humanoid.Health == 100 and
    game.Workspace.TNTxERIC.Humanoid.WalkSpeed == 16 and Tool.Enabled == false and
    mag <= 5 and Workspace.Part2:findFirstChild("Humanoid") then
    for _,v in pairs(game.Players:GetPlayers()) do
    if v.Character then
    v.Character:MoveTo(game.Workspace.Teleport.Position + Vector3.new(0,3,0))
    end end end end)

It's not easy being cheesy. I love Marilyn Mason,Sucicide Silence, and IWABO. Baseplate Maker Plugin here: http://www.roblox.com/Baseplate-maker-plugin-item?id=71012144
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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