1 | local lplayer = game.Players.LocalPlayer |
2 |
3 | local Head = lplayer.Character.Head |
4 |
5 |
6 | while wait() do |
7 | Head.CanCollide = false |
8 | end |
Even infinitely looping the cancollide = false
It still doesn't change to false, any ways of making the CanCollide of it permanently false?
There is a way to keep a players parts CanCollide = false, it's not that complex.
To do this, you want to used Stepped & a Changed event
.
Changed is just use to keep the head cancollide false as a safety or whatever.
01 | local lplayer = game.Players.LocalPlayer |
02 | repeat wait() until lplayer.Character.Head -- Make sure the body part exists, along with character |
03 | local Head = lplayer.Character.Head |
04 | local RS = game:GetService( "RunService" ) -- You can ROBLOX wiki about this server, it has what we want, Stepped |
05 |
06 | RS.Stepped:connect( function () -- Fires every frame in ROBLOX |
07 | Head.CanCollide = false |
08 | end ) |
09 |
10 | Head.Changed:connect( function (Property) |
11 | if Property = = "CanCollide" then |
12 | Head.CanCollide = false |
13 | end |
14 | end ) |
I think I commented all the info about it you need but you can Comment on this Answer if you're confused with something, otherwise accept the answer & thanks
1 | local lplayer = game.Players.LocalPlayer |
2 | local Head = lplayer.Character.Head --Player is called before Character spawns, which creates an error. |
3 |
4 |
5 | while wait() do |
6 | Head.CanCollide = false |
7 | end |
01 | local lplayer = game.Players.LocalPlayer |
02 | local character = lplayer.Character |
03 | if not character or not character.Parent then |
04 | character = lplayer.CharacterAdded:wait() |
05 | end --Add a wait for the character |
06 | local Head = character.Head |
07 |
08 | while wait() do |
09 | Head.CanCollide = false --CanCollide will be set to false, however it won't actually fall through other parts. |
10 | --[[If you wish to kill the player use: ]] Head:Destroy() |
11 | end |
This is due to the humanoid always ensuring that the head, torso, and humanoidrootpart always set cancollide to true. I haven't seen the script but see if there is a method here in CloneTrooper's anti player colliding script that can help removing collisions when touching with other parts:
https://www.roblox.com/Anti-Player-Collision-Script-item?id=316438239