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
 

Arrest

Previous Thread :: Next Thread 
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 05:51 PM
Would someone help me make an arrest tool? When you hit another player with the tool they should be teleported into a building/prison(I can make that much) but after maybe 5-10minutes it should respawn them as another team.
Thanks, if I wasn't clear on anything let me know!
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 05:54 PM
Make a tool. In the tool's handle or something:

script.Parent.Touched:connect(function(hit)
if hit.Parent then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.Character.Torso.CFrame = CFrame.new(x, y, z) -- jail spawn
wait(300) -- 5 minutes
player.TeamColor = BrickColor.new("name") -- new team color name
player.Character.Torso.CFrame = CFrame.new(x, y, z) -- new spawn
end
end
end)

-The [Guy]
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 05:55 PM
actually nevermind that's a terrible way to do it because if the player with the tool dies, I think that script would stop. Instead, have it clone a script into the player he hit and that script will do the waiting and team changing handling, and then it will destroy itself.

-The [Guy]
Report Abuse
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 05:58 PM
How would I do that?
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
11 Oct 2015 05:58 PM
First, remember that Cframe is a place on the map, given by location.
Therefore, if you place a brick at a certain position, then you can obtain the cframe value by that position.
That is how to best use this script posted above.
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 06:01 PM
You would put a script object into the script that is in the tool... like this

> Tool
>> Script for tool
>>> Script that gets cloned into the hit player (disabled by default)

Then in the script for tool...
script.Parent.Touched:connect(function(hit)
if hit.Parent then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.Character.Torso.CFrame = CFrame.new(x, y, z) -- jail spawn
local respawnScript = script.Script:Clone()
respawnScript.Parent = player
respawnScript.Disabled = false
end
end
end)

Then in the script that gets cloned into the hit player:

wait(300) -- 5 minutes
script.Parent.TeamColor = BrickColor.new("name") -- new team color name
script.Parent.Character.Torso.CFrame = CFrame.new(x, y, z) -- new spawn
script:Destroy()

-The [Guy]
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 06:02 PM
ehh add a debounce to that .Touched function otherwise it will clone a ton of scripts into the player lol

-The [Guy]
Report Abuse
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 06:20 PM
Debounce?
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
11 Oct 2015 06:26 PM
http://wiki.roblox.com/index.php/Debounce
basically create an if else script, to force the user to only be hit once by the tool.
Debounce simply creates a controlled environment
Report Abuse
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 06:30 PM
Where would I put it?
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 06:32 PM
So the debounce could be like this, where this is the script for the tool.

local debounce = false
script.Parent.Touched:connect(function(hit)
if debounce then return end
if hit.Parent then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
debounce = true
player.Character.Torso.CFrame = CFrame.new(x, y, z) -- jail spawn
local respawnScript = script.Script:Clone()
respawnScript.Parent = player
respawnScript.Disabled = false
wait(.3)
debounce = false
end
end
end)

-The [Guy]
Report Abuse
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 06:33 PM
Thanks! I really appreciate all your help these past few days!
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
11 Oct 2015 06:34 PM
Happy to help.

-The [Guy]
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
11 Oct 2015 07:06 PM
Happy to help.
Report Abuse
Programatic is not online. Programatic
Joined: 10 Apr 2010
Total Posts: 216
11 Oct 2015 07:07 PM
Use HTML! It'll make everything easier for you!
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
11 Oct 2015 07:29 PM
Html is Programatic.
Report Abuse
CruzeControl is not online. CruzeControl
Joined: 20 Aug 2012
Total Posts: 1073
11 Oct 2015 07:35 PM
Well the script didn't work... Does the tool need a handle?
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
11 Oct 2015 07:36 PM
Every tool needs a handle unless you go free rider, with hopperbins
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