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

Why is the LookVector only works in Studio, but not In Game?

Asked by 5 years ago
Edited 5 years ago

I've been fixing this script for many times, and still don't work in game. What Should I do with this? There are no errors in the output though. :/

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild('Humanoid') then
        if not toggle then
            toggle = true
            local pad = script.Parent
            pad.BrickColor = BrickColor.new('Lime green')
            local thrust = Instance.new('BodyThrust')
            thrust.Force = Vector3.new(0,-2250,0)
            thrust.Parent = hit.Parent:FindFirstChild('HumanoidRootPart')

            hit.Parent:FindFirstChild('HumanoidRootPart').Velocity =    script.Parent.CFrame.LookVector * config:FindFirstChild('BoostForce').Value

            wait(.5)
            pad.BrickColor = BrickColor.new('Fossil')
            pad.Material = ('Metal')
            toggle = false
        end
    end
end)
0
Use remote events, also at line 15 it's supposed to be pad.Material = Enum.Material.Metal mixgingengerina10 223 — 5y
0
Oh ok ty! Traxex16 0 — 5y

Answer this question