|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 07 Jun 2014 06:26 PM |
| mine was latepost just saying |
|
|
| Report Abuse |
|
|
ploki52
|
  |
| Joined: 21 May 2008 |
| Total Posts: 23337 |
|
|
| 07 Jun 2014 06:27 PM |
| yeah yours is more efficient too |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2014 06:27 PM |
| It works but it takes like 0.5 seconds to freeze the player, why? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Jun 2014 06:29 PM |
| @miro walkspeed is not a valid member of Player |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Jun 2014 06:32 PM |
it does it immediately when i test it...
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Jun 2014 06:38 PM |
| Guys, why are you using debounce here? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 07 Jun 2014 06:41 PM |
| So would a solution be to make the part they're touching smaller? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
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 |
|
|
|
| 08 Jun 2014 08:20 AM |
| Why use debounce when you dont even use it. /\ |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|