Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

The script doesn't make the part stick to the head ?

Asked by 7 years ago
local area = Instance.new("Part", player.Character.Head)
    area.Size = Vector3.new(3.45, 3.34, 0.96)
    area.BrickColor = BrickColor.new("Medium stone grey")
    area.Anchored = false
    area.Transparency = 0
    area.CanCollide = false
    area.Shape = "Block"
    area.TopSurface = "Smooth"
    area.BottomSurface = "Smooth"
    area.CFrame = player.Character.Head.CFrame*CFrame.new(0,0,-0.8)
    local weld = Instance.new("Weld", area)
    weld.Part0 = area
    weld.Part1 =  player.Character.Head

There's a part and I made a weld to stick to the head but it keeps falling instead of going infront of my head..

Help please.

0
Your tabbing is weird. OldPalHappy 1477 — 7y
0
Try putting the weld inside of the head..? I don't really know what's wrong with this script honestly Cr_eepy 8 — 7y

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

Perhaps you could try anchoring it, welding it, then unanchoring it.

And in order for the weld to be offset from the head, you need to set it's C0 property.

local area = Instance.new("Part", player.Character.Head)
    area.Size = Vector3.new(3.45, 3.34, 0.96)
    area.BrickColor = BrickColor.new("Medium stone grey")
    area.Anchored = true;
    area.Transparency = 0
    area.CanCollide = false
    area.Shape = "Block"
    area.TopSurface = "Smooth"
    area.BottomSurface = "Smooth"
local weld = Instance.new("Weld", area)
    weld.Part0 = area
    weld.Part1 =  player.Character.Head
    wled.C0 = CFrame.new(0,0,-.8);

wait();
area.Anchored = false;
Ad
Log in to vote
0
Answered by 7 years ago
player = game.Players.LocalPlayer
Mouse = player:GetMouse()

Mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "z" then
local area = Instance.new("Part", player.Character.Head)
    area.Size = Vector3.new(3.45, 3.34, 0.96)
    area.BrickColor = BrickColor.new("Medium stone grey")
    area.Anchored = true;
    area.Transparency = 0
    area.CanCollide = false
    area.Shape = "Block"
    area.TopSurface = "Smooth"
    area.BottomSurface = "Smooth"
local weld = Instance.new("Weld", area)
    weld.Part0 = area
    weld.Part1 =  player.Character.Head
    weld.C0 = CFrame.new(0,0,-.8);
    local mes = script.Mesh:Clone()
    mes.Parent = area
    local rot = script.Script:Clone()
    rot.Parent = area
    local par = script.ParticleEmitter:Clone()
    par.Parent = player.Character.UpperTorso
wait(); -- what you said to do 
area.Anchored = false;
for i = 1, 20 do
    mes.Scale = mes.Scale + Vector3.new(0.004,0.004,-0.00175)
    mes.Offset = mes.Offset + Vector3.new(0,0,-0.0375)
    wait(0.0)
end
wait(0.6)
mes.TextureId = 'rbxassetid://756808353'
for i = 1, 10 do
    mes.Scale = mes.Scale + Vector3.new(0.003,0.003,-0.002)
    mes.Offset = mes.Offset + Vector3.new(0,0,0.01)
    wait()
end
wait(0.4)
for i = 1, 10 do
    mes.Scale = mes.Scale + Vector3.new(0.02,0.02,0)
    mes.Offset = mes.Offset + Vector3.new(0,0,-0.5)
    area.Transparency = area.Transparency + 0.1
    wait()
end
par:remove()
    area:Remove()
    end
end)

look here is the full script I tried what you said but it didn't work...

Answer this question