local lplayer = game.Players.LocalPlayer local HumT = lplayer.Character.Torso local LeftA = lplayer.Character["Left Arm"] local LeftL = lplayer.Character["Left Leg"] local RightA = lplayer.Character["Right Arm"] local RightL = lplayer.Character["Right Leg"] local Head = lplayer.Character.Head local RepStore = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") function OnPlayerAdded(plr) print("Hello!") local part2 = RepStore.Blocky:Clone() part2.Parent = game.Workspace local weld = Instance.new("Weld") weld.Parent = part2 weld.Part0 = part2 part2.Parent = HumT weld.Part1 = HumT weld.C0 = CFrame.new(0,0,0) weld.C1 = CFrame.new(0,0,0) end for _,v in pairs(Players:GetPlayers()) do OnPlayerAdded(v) end game.Players.PlayerAdded:connect(OnPlayerAdded) myTable = {LeftA, LeftL, RightA, RightL, Head, HumT} for i,v in pairs(myTable) do v.Transparency = 1 end RightL:remove() LeftL:remove() RightA:remove() LeftA:remove() print("Deleting Hats....") wait(2) for k,s in pairs(lplayer.Character:GetChildren())do if s:IsA("Hat") and Head.face.Texture ~= nil then s:Destroy() s:remove() end end for l,r in pairs(lplayer.Character.Head:GetChildren()) do if r:IsA("Decal") then r:remove() end end print("Done deleting them!") Head.CanCollide = false HumT.CanCollide = false print("The head is now passable") local bp = Instance.new("BodyPosition", HumT.Blocky) bp.MaxForce = Vector3.new(0,100,0)
The Localscript is in StarterGui.
It only works in Roblox Studio. Not in a normal game.
You're trying to get the character before the character has spawned. This can be easily remedied by adding repeat wait() on line 2:
local lplayer = game.Players.LocalPlayer repeat wait() until lplayer.Character local HumT = lplayer.Character.Torso local LeftA = lplayer.Character["Left Arm"] local LeftL = lplayer.Character["Left Leg"] local RightA = lplayer.Character["Right Arm"] local RightL = lplayer.Character["Right Leg"] local Head = lplayer.Character.Head local RepStore = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") function OnPlayerAdded(plr) print("Hello!") local part2 = RepStore.Blocky:Clone() part2.Parent = game.Workspace local weld = Instance.new("Weld") weld.Parent = part2 weld.Part0 = part2 part2.Parent = HumT weld.Part1 = HumT weld.C0 = CFrame.new(0,0,0) weld.C1 = CFrame.new(0,0,0) end for _,v in pairs(Players:GetPlayers()) do OnPlayerAdded(v) end game.Players.PlayerAdded:connect(OnPlayerAdded) myTable = {LeftA, LeftL, RightA, RightL, Head, HumT} for i,v in pairs(myTable) do v.Transparency = 1 end RightL:remove() LeftL:remove() RightA:remove() LeftA:remove() print("Deleting Hats....") wait(2) for k,s in pairs(lplayer.Character:GetChildren())do if s:IsA("Hat") and Head.face.Texture ~= nil then s:Destroy() s:remove() end end for l,r in pairs(lplayer.Character.Head:GetChildren()) do if r:IsA("Decal") then r:remove() end end print("Done deleting them!") Head.CanCollide = false HumT.CanCollide = false print("The head is now passable") local bp = Instance.new("BodyPosition", HumT.Blocky) bp.MaxForce = Vector3.new(0,100,0)