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

My particles when you land are spawning really high for some reason?

Asked by 3 years ago
Edited 3 years ago
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()
        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.Script.Name = workplayer.Name
            local wind = game.ReplicatedStorage.PowerParts.wind:Clone()
            land.Parent = game.Workspace
            wind.Parent = game.Workspace
            land.Size = land.Size/2
            local info = TweenInfo.new(1)
            local prop = {Size = land.Size*2,Orientation = land.Orientation + Vector3.new(0,100,0),Transparency = 1}
            local prop2 = {Size = Vector3.new(14.2, 1.106, 13.207),Orientation = wind.Orientation + Vector3.new(0,100,0),Transparency = 1}
            tw:Create(land,info,prop):Play()
            tw:Create(wind,info,prop2):Play()
            wind.CFrame = plrRp.CFrame 
            land.CFrame = plrRp.CFrame
            part:Destroy()
            weld:Destroy()
            wait(1)
            land:Destroy()
            wind:Destroy()
            plrRp.Anchored = false

Answer this question