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

how come this wont move straight?

Asked by 10 years ago

im changing a crushing wall script for my Deathrun 2 map (dont mind the strings Wsly wrote them) and it moves kinds tilted, how do i make it move in 1 direction straight?

-- Waiting Animation
Decal = script.Parent.Decal
Locked = game.Workspace.Data.Images.WaitTimers.Locked.Value
ClockA = game.Workspace.Data.Images.WaitTimers.ClockA.Value
ClockB = game.Workspace.Data.Images.WaitTimers.ClockB.Value
ClockC = game.Workspace.Data.Images.WaitTimers.ClockC.Value
ClockD = game.Workspace.Data.Images.WaitTimers.ClockD.Value
Duration = 6 -- Duration of the clock animation in seconds
Platform = script.Parent.Parent.Parent.Platform

function Activate() -- Trap wordt geactiveerd
    if script.Parent.BrickColor == BrickColor.new("Camo") then
        script.Parent.BrickColor = BrickColor.new("Deep orange") -- Check of trap al geactiveerd is
        for i = 1, 10 do
        wait(0.025)
        Platform.CFrame = Platform.CFrame + Vector3.new(-1, 0, 0)
        end 
        wait(3)
        for i = 1, 10 do
        wait(0.025)
        Platform.CFrame = Platform.CFrame + Vector3.new(1, 0, 0)
        end 
        script.Parent.BrickColor = BrickColor.new("Bright red") -- Button wordt rood, cooldown begint
        for i = 1,Duration do -- Cooldown animatie
            Decal.Texture = ClockA
            wait(0.25)
            Decal.Texture = ClockB
            wait(0.25)
            Decal.Texture = ClockC
            wait(0.25)
            Decal.Texture = ClockD
            wait(0.25)
        end -- Einde cooldown animatie
        Decal.Texture = ""
        script.Parent.BrickColor = BrickColor.new("Camo") -- Reset van cooldown, Trap kan weer geactiveerd worden
    end
end
script.Parent.ClickDetector.MouseClick:connect(Activate)

1 answer

Log in to vote
0
Answered by 10 years ago
Platform.CFrame = CFrame.new(Platform.CFrame.p+Vector3.new(NUM,NUM,NUM)
--Change the numbers to go back or forth
0
You forgot the parentheses that closed the first set, but thanks bubbaman73 143 — 10y
0
doesnt work bubbaman73 143 — 10y
Ad

Answer this question