Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I am trying to make a thing like 'noclip' to go through walls?

I am trying to make CanCollide = false because I would think that if it was false, players can go through it when clicking the gui button.

Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
	while wait() do
		print'd'
		Player.Character.Torso.CanCollide = false
		Player.Character.Head.CanCollide = false
	end
end)

4 comments

0

Wouldn't it be easier to make it so colliding into something you just move on to the other side of the 'wall'?

0

This code looks right

0

Well there is some other code maybe it is implemented into roblox. But the other code is making it true every .0000000000000000000000000000000000000000000000000000000001 second it seems.

0

Oh, you might have to make a custom character then

2 answers

✓ Accepted answer

I've wanted to do this in the past, but I thought, 'Hmm, doesn't EISS do this?'. And after just minutes of searching through the code I found how he did it. He used the ChangeState function of the humanoid, by changing it to state 11 (no physics), you'll be no-clipping! Here's the code you should use:

Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
	while wait() do
		Player.Character.Humanoid:ChangeState(11)
	end
end)

1 comment

0

Thanks!

Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
    while wait() do
        print'd'
        local Body = Player.Character:GetChildren()
		Body.CanCollide = false
    end
end)

This should work. The Head and Torso of a Player are not the only parts, but instead of just naming every part, (i.e. Right Arm, Left Arm ect...) just use the GetChildren() Function. If this doesn't work, use this code:

Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
    while wait() do
        print'd'
        Player.Character.Torso.CanCollide = false
        Player.Character.Head.CanCollide = false
	Player.Character["Right Arm"].CanCollide = false
	Player.Character["Left Arm"].CanCollide = false
	Player.Character["Right Leg"].CanCollide = false
	Player.Character["Left Leg"].CanCollide = false
    end
end)

6 comments

0

Not making all body pats Cancollide = false

0

What do you mean?

0

So what I am trying to do it being able to walk through any part when clicking the gui button.

0

What's happening with my script that I gave you?

0

It does not change the part's cancollide to false. There is something that is looping and making the cancollide == true ;(

0

Sorry, I can't help you then. I don't know what's going on.

This discussion is preserved as it was. New answers, comments, and votes are closed.