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

This part keeps on spawning above the players head?

Asked by 2 years ago
Edited 2 years ago

https://drive.google.com/file/d/1l5kgK_XCPmdg2-SxsQDCQkom-VVzs4C4/view?usp=sharing Basically what I to is weld the player to the part then break it after a millisecond. I tried simply setting the position to the player but still its spawning above. When it breaks the weld it spawns above.

game.ReplicatedStorage.PizzaPower2Remote.OnServerEvent:Connect(function(player)
    local workplayer = game.Workspace:FindFirstChild(player.Name)
    local plrRp = workplayer:FindFirstChild("HumanoidRootPart")
    local jump = Instance.new("BodyPosition")
    local tw = game:GetService("TweenService")
    local pos = plrRp.CFrame * Vector3.new(0,30,0)
    local pos = pos + plrRp.CFrame.LookVector*10
    local landing = true
    local db2 = false
    for i, track in pairs (workplayer:FindFirstChild("Humanoid"):GetPlayingAnimationTracks()) do
        track:Stop()
    end
    workplayer:FindFirstChild("Humanoid"):LoadAnimation(script.Jump):Play()
    jump.Parent = plrRp
    jump.Position = pos
    jump.D = 150
    jump.P = 600
    wait(0.7)
    jump:Destroy()
    local weld = Instance.new("Weld",workplayer:FindFirstChild("RightFoot"))
    local part = Instance.new("Part",game.Workspace)
    part.Transparency = 1
    part.Anchored = false
    part.CanCollide = false
    weld.Part0 = workplayer:FindFirstChild("RightFoot")
    weld.Part1 = part
    weld.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
    local db = false
    db = false
    print(db)
    part.Touched:Connect(function(hit)
        if db == false then
            db = true
            print("Runned")
            plrRp.Anchored = true
            workplayer:FindFirstChild("Humanoid"):LoadAnimation(script.Land):Play()
            local land = game.ReplicatedStorage.PowerParts.land:Clone()
            land.Handle.Script.Name = workplayer.Name
            local wind = game.ReplicatedStorage.PowerParts.wind:Clone()
            land.Parent = workplayer
            wind.Parent = workplayer
            land.Handle.Size = land.Handle.Size/2
            local info = TweenInfo.new(1)
            local prop = {Size = land.Handle.Size*2,Orientation = land.Handle.Orientation + Vector3.new(0,100,0),Transparency = 1}
            local prop2 = {Size = Vector3.new(14.2, 1.106, 13.207),Orientation = wind.Handle.Orientation + Vector3.new(0,100,0),Transparency = 1}
            tw:Create(land.Handle,info,prop):Play()
            tw:Create(wind.Handle,info,prop2):Play()
            wait(0.5)
            land.Handle.Anchored = true
            wind.Handle.Anchored = true
            land.Handle.WaistCenterAttachment:Destroy()
            wind.Handle.WaistCenterAttachment:Destroy()
            land.Handle.AccessoryWeld:Destroy()
            wind.Handle.AccessoryWeld:Destroy()
            part:Destroy()
            weld:Destroy()
            wait(1)
            land:Destroy()
            wind:Destroy()
            plrRp.Anchored = false
        end

end)
end)
0
show me the code please UwU imKirda 4491 — 2y
0
Ok robot7866 36 — 2y

Answer this question