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

Getting an error when attempting to run this part cloning code. How should I fix it?

Asked by 7 years ago

Alright, I'm new to scripting, and I tried to re-create a script from one of ROBLOX's tutorials. It just doesn't work. I was wondering if anyone could help. I've tried everything I could think of, but it just won't work. I tried going to the fourms, but ROBLOX censored like half of it.

I'm just trying to make a clone of an Exploding Ball happen at random positions.

local explodingPart = game.ServerStorage.ExplodingPart
local explodingPartDropHeight = 75

local function createExplodingPartCopy()
    local explodingPartCopy = explodingPart:Clone()
    explodingPartCopy.Parent = game.Workspace
    local xRan = math.random(-164,164)
    local zRan = math.random(-164,164)
    explodingPartCopy.Positon = Vector3.new(xRan, explodingPartDropHeight, zRan)
end 


while true do
    createExplodingPartCopy()
    wait(1)
end

Error : - Positon is not a valid member of Part

1
Position User#5423 17 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

You simply mistyped Position.

local explodingPart = game.ServerStorage.ExplodingPart
local explodingPartDropHeight = 75

local function createExplodingPartCopy()
    local explodingPartCopy = explodingPart:Clone()
    explodingPartCopy.Parent = game.Workspace
    local xRan = math.random(-164,164)
    local zRan = math.random(-164,164)
    explodingPartCopy.Position = Vector3.new(xRan, explodingPartDropHeight, zRan)
end 


while true do
    createExplodingPartCopy()
    wait(1)
end
Ad
Log in to vote
0
Answered by 7 years ago

As deranged_JoJo said, you jsut misspelled Position. An spelling error like that could be found using the Output. It would say something along the lines of "Positon not being a valid member of explodingPartCopy."

0
A separate answer was not necessary to back up what I said. You could have simply posted a comment on my reply saying what you just said... joritochip 705 — 7y

Answer this question