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

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

Asked by 5 years ago
Edited 5 years ago

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
0
position isn't a property of tool bhqpping 80 — 5y
0
Do you want to have it in a players inventory or a gui of some sort? RebornedInFire 35 — 5y
0
@RebornedInFire yeah that was the general goal RobbyBobby2643 2 — 5y

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

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
Ad

Answer this question