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

Unable to cast double to Coordinateframe?

Asked by 9 years ago

Line 27:

x:SetPrimaryPartCFrame(CFrame.new(math.random(-200,200),math.random(50,100), math.random(-200,200)))

What am I doing wrong?

[Edits:]

while wait() do
    local P = Instance.new("Part")
    local M = Instance.new("SpecialMesh")
    M.MeshId = game.ReplicatedStorage.Taco.MeshId
    M.TextureId = game.ReplicatedStorage.Taco.TextureId
    P.CanCollide = false
    if plr:FindFirstChild("Shape").Value == "Taco" then
        P.Rotation = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
        P.Size = Vector3.new(10, 10, 10)
        P.BrickColor = BrickColor.Random()
        P.Parent = game.Workspace.CurrentCamera
        P.Position = Vector3.new(math.random(-200,200),math.random(50,100),math.random(-200,200))
        M.Parent = P
        M.Scale = Vector3.new(10, 10, 10)
        light = Instance.new("PointLight", P)
        light.Color = P.BrickColor.Color
        wait(5)
        debris:AddItem(P, 5)
    elseif plr:FindFirstChild("Shape").Value == "FearMeIAmLag" then
        x = game.ReplicatedStorage.FearMeIAmLag:Clone()
        x:SetPrimaryPartCFrame(CFrame.new(math.random(-200,200),math.random(50,100), math.random(-200,200))) -- Here
    else
        P.Rotation = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
        P.Size = Vector3.new(10, 10, 10)
        P.BrickColor = BrickColor.Random()
        P.Parent = game.Workspace.CurrentCamera
        P.Position = Vector3.new(math.random(-200,200),math.random(50,100),math.random(-200,200))
        light = Instance.new("PointLight", P)
        light.Color = Color3.new()
        if plr:FindFirstChild("Shape").Value == "Ball" then P.Shape = "Ball"; elseif plr:FindFirstChild("Shape").Value == "Block" then P.Shape = "Block"; end
        debris:AddItem(P, 5)
    end
end
1
This line runs fine for me. Are you sure this is the correct line from the correct script? Could you provide surround lines, since sometimes Lua is off by a few due to whitespace? BlueTaslem 18071 — 9y
0
Done ZirutoHellfire 10 — 9y
0
Oh and the Taco mesh parts don't appear as quick/rapid as the actual parts any explanations on that too? ZirutoHellfire 10 — 9y
0
I just realiesed I didn't parent it .-. ZirutoHellfire 10 — 9y

Answer this question