Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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 comment

1

Position

2 answers

✓ Accepted answer

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

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."

1 comment

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...

This discussion is preserved as it was. New answers, comments, and votes are closed.