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

Error- Position is not a valid member of Tool (What??)

Hey- I'm a newcomer to Roblox's programming and I'm trying to make a system where you can pick up copper ores for use later in the game. I decided the easiest way to do so would probably be to make this a tool, but (of course) I ran into an error. All it tells me is that Position is not a valid member of Tool, which I have no clue how to fix. Anyone got any ideas, or rather a better way to go about this?

code-

local Copper = game.ServerStorage.Copper
local CopperDropHeight = 333
local gameRoundLengthInSeconds = 900


local function createCopperCopy()
	local CopperCopy = Copper:Clone()
	CopperCopy.Parent = game.Workspace
	local xPosition = math.random (2346.5, 2894.5)
	local zPosition = math.random (-1144, -596)
	CopperCopy.Position = Vector3.new(xPosition, CopperDropHeight, zPosition)
end
for i = 1, 9999999999999999999999999999999 do
local i = 1
repeat
  createCopperCopy()
   i = i + 1
until i==4
wait(gameRoundLengthInSeconds)
end

3 comments

0

position isn't a property of tool

0

Do you want to have it in a players inventory or a gui of some sort?

0

@RebornedInFire yeah that was the general goal

1 answer

the tool does not have a position property. you can instead change it's handle's C-Frame:


local function createCopperCopy()
    local CopperCopy = Copper:Clone()
    CopperCopy.Parent = game.Workspace
    local xPosition = math.random (2346.5, 2894.5)
    local zPosition = math.random (-1144, -596)
    CopperCopy.CFrame = CFrame.new(xPosition, CopperDropHeight, zPosition)
end


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