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

Any help with Touched and values?

Asked by
1GlF 42
6 years ago

Please tell me why this won't work, I've been wondering for like a hour from now (And yes I changed the Owner value)

if hit.Name == "ActiveRocket" and script.Parent.Parent.Owner.Value == not hit.Owner.Value then
        script.Disabled = true
        hit.Name = "DeactivatedRocket"
        hit.Explosion.Enabled = true
        hit.Boom:Play()
        hit.RocketMove.Disabled = true
        hit.CollisionGroupId = 1
        hit.Anchored = true
        hit.Shockwave.Enabled = true
        hit.Transparency = 1
        wait(0.125)
        script.Parent.Spinout.Disabled = false
        hit.Shockwave.Enabled = false
        wait(0.75)
        hit.Explosion.Enabled = false
        wait(0.3)
        hit:Destroy()
        script.Disabled = false
    end
0
What wont work? Simnico99 206 — 6y
0
When the Owner value in the car is changed to be different than the one in the rocket, it still doesn't work 1GlF 42 — 6y
0
Any error? Simnico99 206 — 6y
0
Nope 1GlF 42 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

not hit.Owner.Value is false (Unless Owner.Value is nil)

Fix this by using

script.Parent.Parent.Owner.Value ~= hit.Owner.Value

instead

0
Works! Thanks! 1GlF 42 — 6y
Ad

Answer this question