I am making a script to drop an item when i click a button gui, i want it to clone a model from lighting and put it under the player but i cant make it work!
this is the part that have a problem
local drop = game.Lighting:FindFirstChild(itemC.Value):FindFirstChild(item.Value):clone() drop.Parent = game.Workspace.Drops drop.Position = player.Character.Torso.PositionXYZ
You have two problems in this script:
First: Models do not have a Position
property so you need to use the MoveTo
function for this
Second: The position you need to move to has to be a new Vector3
so try:
drop:MoveTo(Vector3.new(player.Character.Torso.Position) --XYZ won't work
You can also use SetPrimaryPartCFrame()
to do this too, just make a certain part your PrimaryPart
of a model, then use SetPrimaryPartCFrame()
to move it. (SurVur pointed this out to me)