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
 

Re: How do i?

Previous Thread :: Next Thread 
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:09 PM
How do i make it to wherw when a player touches a part they freeze for a certain amount of time then thaw?
Report Abuse
ploki52 is not online. ploki52
Joined: 21 May 2008
Total Posts: 23337
07 Jun 2014 06:12 PM
debounce = 0
function touch(part)

if part.Parent == nil then return end
if part.Parent.Torso ~= nil then
debounce = 1
part.Parent.Torso.Anchored = true
wait(what every amount of seconds you want)
part.Parent.Torso.Anchored = false
debounce = 0
end
end
end
script.Parent.Touched:connect(part)
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:17 PM
Doesn't freeze
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:21 PM
I dont think u called the player out just tried to find something named Torso inside of Part right?
Report Abuse
ploki52 is not online. ploki52
Joined: 21 May 2008
Total Posts: 23337
07 Jun 2014 06:23 PM
debounce = 0
function touch(part)

if part.Parent:findFirstChild("Humanoid") ~= nil then
if part.Parent.Torso ~= nil then
debounce = 1
part.Parent.Torso.Anchored = true
wait(what ever amount of seconds you want)
part.Parent.Torso.Anchored = false
debounce = 0
end
end
end
script.Parent.Touched:connect(touch)

sorry, messed up on last line
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
07 Jun 2014 06:26 PM
debounce = false
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid ~= nil then
debounce = true
hit.Parent.Humanoid.Walkspeed = 0
wait(5)--change how many seconds
hit.Parent.Humanoid.Walkspeed = 16
debounce = false
end
end)

--how bout tat
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
07 Jun 2014 06:26 PM
mine was latepost just saying
Report Abuse
ploki52 is not online. ploki52
Joined: 21 May 2008
Total Posts: 23337
07 Jun 2014 06:27 PM
yeah yours is more efficient too
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:27 PM
It works but it takes like 0.5 seconds to freeze the player, why?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
07 Jun 2014 06:28 PM
local freezetime = 5; --change
local debounce = false;
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true;
local player = hit.Parent:findFirstChild('Humanoid');
if player ~= nil then
player.WalkSpeed = 0;
wait(5);
player.WalkSpeed = 16;
end
debounce = false;
end
end)

Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:29 PM
@miro walkspeed is not a valid member of Player
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:31 PM
@vid ty it works but how do i make it to where it stops them immediatly, theres about a 0.5 second delay when u touch it
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
07 Jun 2014 06:32 PM
it does it immediately when i test it...

Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:33 PM
If i walk my player straight forward into the part i keep on going for 0.5 then stops. Its not big it works fine just wondering if theres a a way to change it.
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
07 Jun 2014 06:38 PM
Guys, why are you using debounce here?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
07 Jun 2014 06:39 PM
because when they're frozen, they'll still be touching the part, stopping them from basically being stuck there.

Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
07 Jun 2014 06:41 PM
So would a solution be to make the part they're touching smaller?
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Jun 2014 07:58 AM
@OP

Change the word Walkspeed to WalkSpeed. Try tat.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Jun 2014 08:16 AM
debounce = false
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid ~= nil then
debounce = true
hit.Parent.Humanoid.Walkspeed = 0
wait(5)--change how many seconds
hit.Parent.Humanoid.Walkspeed = 16
debounce = false
end
end
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Jun 2014 08:17 AM
Try that
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Jun 2014 08:19 AM
Wow how stupid of me...
Try this: (not ment to spam. I forgot to change tweaks on the second edit)
debounce = false
script.Parent.Touched:connect(function(hit)
if hit.Parent.Humanoid ~= nil then
debounce = true
hit.Parent.Humanoid.WalkSpeed = 0
wait(5)--change how many seconds
hit.Parent.Humanoid.WalkSpeed = 16
debounce = false
end
end
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
08 Jun 2014 08:20 AM
Why use debounce when you dont even use it. /\
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
08 Jun 2014 08:24 AM
Ah screw that. Yolo
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