Hi I'm trying to make an obby where a part has to do with Gravity Falls. If you know that programme you will know the eye bats who turn people to stone. I just need code for when you hit a part you turn to stone colour and freeze, then after a second die. Someone has suggested some code before but once used nothing happened. I'm not really a coder so can someone please help. Thanks
Btw here is the code aforementioned.
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
wait(1)
for a, b in pairs(Character:GetDescendants()) do
if b:IsA("BasePart") then
b.Touched:Connect(function(hit)
if hit.Parent.Name == "EyeBat" then
for c, d in pairs(Character:GetDescendants()) do
-- Set Color
local color = Color3.fromRGB(150, 150, 150)
if d.Name == "Body Colors" then
d.HeadColor3 = color
d.RightArmColor3 = color
d.LeftArmColor3 = color
d.RightLegColor3 = color
d.LeftLegColor3 = color
d.TorsoColor3 = color
-- Set Frozen (d.Anchored = true is possible)
elseif d.Name == "Humanoid" then
d.WalkSpeed = 0
d.JumpPower = 0
-- Removes Shirt Id (Optional)
elseif d.Name == "Shirt" then
d.ShirtTemplate = ""
--Removes Pants Id (Optional)
elseif d.Name == "Pants" then
d.PantsTemplate = ""
end
-- Changes Material / PartColor to Slate / Grey
if d:IsA("BasePart") then
d.Material = Enum.Material.Slate
d.Color = color
-- Makes Accessories Grey (Optional)
elseif d:IsA("SpecialMesh") then
d.TextureId = ""
end
end
end
end)
end
end
end)
end)

2 comments
Thank you so much! This helped so much!
Np have fun!