1 | function onTouch(Player) |
2 | if GetRankInGroup( 947529 ) > = 9 then |
3 | script.Parent.CanCollide = false |
4 | wait ( 1 ) |
5 | script.Parent.CanCollide = true |
6 | end |
7 | end |
8 |
9 | script.Parent.Touched:connect(onTouch) |
...Fixed.
1 | function onTouch(hit) |
2 | local plr = game.Players:GetPlayerFromCharacter(hit.Parent) |
3 | if plr = = nil or plr:GetRankInGroup( 947529 ) < 9 then return end |
4 | script.Parent.CanCollide = false |
5 | wait( 2 ) |
6 | script.Parent.CanCollide = true |
7 | end |
8 |
9 | script.Parent.Touched:connect(onTouch) |
If the above doesn't work, use the same answer as what Code used and add: 1) outside of the function put ~~~~~~~~~~~~~~~~~ debounce = false
1 | Right under |
2 | ~~~~~~~~~~~~~~~~~ |
3 | if plr = = nil or plr:GetRankInGroup( 947529 ) < 9 then return end |
add:
1 | debounce = true |
also under
1 | script.Parent.CanCollide = true |
add:
1 | debounce = false |
This is all only if the answer above doesn't work, the answer corrects a mistake but I don't have time to test it so I am just giving you a solution if the answer doesn't work.