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: How to prevent

Previous Thread :: Next Thread 
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
14 May 2016 06:24 PM
players from backspacing gears through a wall. I don't want them to be able to do that through a wall, only in the arena
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
14 May 2016 06:25 PM
Make a transparent part, make sure its cancollide behind the wall or something


Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 06:33 PM
All tools should have a CanBeDropped boolean property
If you set it to false for all of their equipment, they won't be able to drop it
You can use a script that switches it back and forth from being droppable or not when they get close to arena walls if you want them to still be able to do it,

Alternatively, you can teleport the handle of the gear when it's parented to the workspace
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
14 May 2016 06:36 PM
yeah but the goal of my game is to drop them on ur base using backspace.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
14 May 2016 06:41 PM
b
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 06:45 PM
Alright so, you want a script that enables dropping them only when they're in a certain area, such as standing by their base?
Report Abuse
xThe_Developer is not online. xThe_Developer
Joined: 07 Aug 2013
Total Posts: 585
14 May 2016 06:45 PM
Do what the man above said. Change it to CanBeDropped false in some areas and the opposite in others.


#code mod = require(sike) if not mod.xThe[...] then print("You're not RbxDev yet..") end
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 06:51 PM
man? i identify as an apache attack helicopter
Report Abuse
WoolHat is not online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
14 May 2016 06:57 PM
This idea is a little different.

1.) set CanBeDropped to false.
2.) detect when a player presses backspace, via UserInputService
3.) do a :GetTouchingParts() on the tool's handle. If no parts are touching the handle (with the exception of anything a child of the character or tool), parent the tool to the workspace.
4.) Just make your exterior walls extra thick
Report Abuse
Void_Optics is not online. Void_Optics
Joined: 21 Mar 2016
Total Posts: 286
14 May 2016 06:58 PM
After you drop it, raycast to it do detect if there's anything in the way. If not, parent it back to the backpack
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
14 May 2016 07:01 PM
@Jam yes
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
14 May 2016 07:04 PM
@Wool then it goes on top of the walls
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 07:13 PM
you could use magnitude
this is totally untested btw

BasePositions = {["Bright red"] = Vector3.new(0, 0, 0),
["Bright blue"] = Vector3.new(0, 0, 0)}
BaseRadius = 10
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character.ChildAdded:connect(function(Child)
if Child.ClassName == "Tool" then
while Character:FindFirstChild("Torso") and BasePositions[Player.TeamColor.Name] and Child.Parent == Character do
if (Character.Torso.Position - BasePositions[Player.TeamColor.Name]).Magnitude <= BaseRadius then
Child.CanBeDropped = true
else
Child.CanBeDropped = false
end
wait()
end
end
end)
end)
end)

just set the team names and center of the bases at the top of the script, it -should- prevent tools from being dropped when the player is away from their own base
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
14 May 2016 07:27 PM
@Jammer622 It's recommended to use DistanceFromCharacter instead of magnitude when comparing distance from a player.

http://wiki.roblox.com/index.php?title=API:Class/Player/DistanceFromCharacter
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 07:29 PM
too bad i always set things up to work with bots
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
14 May 2016 07:31 PM
@Jammer622 you're not even using "bots" (which this wouldn't even make sense if it was for because any good "bot" wouldn't even try to drop their tool on the other side of a wall)
do you just like to be less efficient? :/
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 07:35 PM
you're being very narrowminded about that
i mean i use bots in all of my own work, so its habit that i use the same code layout
why does it matter to you if im inefficient or not anyways, do you just like to bag on people
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
14 May 2016 07:36 PM
Then do this:

pos1.X - pos2.X * pos1.Y - pos2,Y then get the square root of that.

TADA
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
14 May 2016 07:39 PM
but- but that's 2d
we need 3d points in space

sqrt((pos1.X-pos2.X)^2+(pos1.Y-pos2.Y)^2+(pos1.Z-pos2.Z)^2)
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
14 May 2016 07:40 PM
"i mean i use bots in all of my own work, so its habit that i use the same code layout"
Please re-read my post. I stated that any good "bot" would not even try to drop their tool on the other side of the wall, so your argument is invalid.

"why does it matter to you if im inefficient or not anyways, do you just like to bag on people"
i'm trying to change roblox one idiot at a time
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