This is the script that I thought of:
1 | hit = Workspace.WiseDumbledore |
2 | for _,ch in ipairs (hit:GetChildren()) do |
3 | if ch.className = = 'Part' then |
4 | ch.Transparency = 1 |
5 | ch.CanCollide = false |
6 | ch.Anchored = true |
7 | end |
8 | end |
This poses a few problems. When
1 | ch = hit.Head |
or
1 | ch = hit.Torso |
The line
1 | ch.CanCollide = false |
will be non effective. Also the face will not be invisible. Others suggested:
1 | Workspace.WiseDumbledore: remove() |
and
1 | Workspace.WiseDumbledore.Parent = "Lighting" |
These scripts will not allow the target to reset. Please help.
Thanks WiseDumbledore
01 | local hitPart = Workspace.WiseDumbledore |
02 | local player = Game.Players:GetPlayerFromCharacter(hitPart) |
03 | if player then |
04 | for index, object in pairs (player.Character:GetChildren()) do |
05 | if object:IsA( "BasePart" ) then |
06 | object.Transparency = 1 |
07 | object.CanCollide = false |
08 | object.Anchored = true |
09 | if object:FindFirstChild( "face" ) then |
10 | object.face.Transparency = 1 |
11 | end |
12 | elseif object:IsA( "Hat" ) and object:FindFirstChild( "Handle" ) then |
13 | object.Handle.Transparency = 1 |
14 | object.Handle.CanCollide = false |
15 | object.Handle.Anchored = true |
16 | end |
17 | end |
18 | end |
1 | function onTouch(part) |
2 | local humanoid = part.Parent:FindFirstChild( "Humanoid" ) |
3 | if (humanoid ~ = nil ) then -- if a humanoid exists, then |
4 | humanoid.Parent.Torso.Anchored = true |
5 | end |
6 | end |
7 |
8 | script.Parent.Touched:connect(onTouch) |
And for disable reset (Put in StarterGui and make sure it's a localscript)
1 | function onTouch(part) |
2 | game:GetService( "StarterGui" ):SetCore( "ResetButtonCallback" , false ) |
3 | end |
4 |
5 | game.Workspace.Part.Touched:connect(onTouch) |
Make sure the "Part" is changed to your bricks name
This will work... You cant Move, or be interacted with. At the same time you CAN reset.
01 | function Freeze(char) |
02 | if char and char:IsA( "Model" ) then |
03 | for i,v in pairs (char:children()) do |
04 | if v.className = = "Part" then |
05 | v.Transparency = 1 |
06 | v.CanCollide = false |
07 | end |
08 | if v.className = = "Hat" then |
09 | v.Handle.Transparency = 1 |
10 | v.Handle.CanCollide = false |
11 | v.Handle.Anchored = true |
12 | end |
13 | if v.Name = = "Head" then |
14 | v.face.Transparency = 1 |
15 | end |
16 | end |
17 | end |
18 | end |
19 |
20 | --If you want to freeze a player, Do Freeze(game.Players.Roblox.Character) |