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

How would I make a model teleport to a player?

Asked by 6 years ago

I am trying to make my own Kohls Admin Infinite custom command that places a tree in front of you. I have the tree model and I have successfully been able to clone it and move the clone into the workspace. But I am having trouble getting it to the player. Could anyone help? Here is the code:

{{'Plant','TreeCreate'},{'Plants a tree in front of you!','Kohl Number'},2,{'player'},function(pl,args) for i, player in pairs do local TC = game.ReplicatedStorage.TreeCommand:Clone() TC.Parent = game.Workspace TC:SetPrimaryPartCFrame(player.Character:GetPrimaryPartCFrame() * CFrame.new(2,-5,2)) wait(3) TC:Destroy() end end}

1
Please format your code with a code block. Eqicness 255 — 6y
0
It's hard to interpret the code, but try replacing player.Character with pl.Character mattscy 3725 — 6y

Answer this question