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

Rocketpropulsion not working on players?

Asked by 4 years ago

So I learned rocketpropulsion and tinkered around with it. I wanted to try homing on other players as well.

while wait() do
    local player = game.Players.LocalPlayer
    local chara = player.Character




local wee = Instance.new("Part")
wee.Name = ("rocket")
wee.Anchored = false
--wee.CanCollide = false
wee.BrickColor = BrickColor.new("Royal purple")
wee.Shape = Enum.PartType.Ball
    wee.Parent = script.Parent.Torso
    wee.Size = Vector3.new(1,1,1)
    Instance.new("Sparkles", wee)
    wee.Transparency = 0.2
    wee.CFrame = script.Parent.Torso.CFrame * CFrame.new(0,0,-7)
    wee.Material = Enum.Material.CrackedLava

------------------------------------------------------------------
if chara then
local RP = Instance.new("RocketPropulsion", wee)
    RP.Target = chara
    RP:Fire()



wait(6)
wee:Destroy()

    end
    end

But I got an error, saying "Workspace.Model.Rocketproplusion:11: attempt to index nil with 'Character'" Did I reference the player the wrong way? Or does character not work with rocketpropulsion?

Answer this question