So , when ever this function got called it will spawn a random Item
local function SpawnItems() local Items = game.ReplicatedFirst.CrateItems:GetChildren() local RandomItem = Items[math.random(1, #Items)] print(RandomItem.Name.." Chosen.") RandomItem:Clone().Parent = game.Workspace print(RandomItem.Name.." Spawned.") RandomItem.Main.CFrame = CFrame.new(TargetLocation) print(RandomItem.Name.." Moved.") end
using
RandomItem.Main.CFrame = CFrame.new(TargetLocation)
doesn't make the 'tool' be at a certain locaton.
How do I change a 'tool' location?
To do this you will have to change the Handle of the tools CFrame heres an example
wait() local location = game.Players.LocalPlayer.Character.Head.Position game.Workspace.Handgun.Handle.CFrame = CFrame.new(location)
This would teleport it to the players head and make them equip it.