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

I need help with simple cloning?

a = script.Parent.Parent.Parent.Parent.Parent.Character
l = game.Workspace.lol.Button.CFrame
local player = game.Players.LocalPlayer
function b ()
local storage = game:GetService("ServerStorage")
local part = storage["Seat"]:Clone() 
part.Parent = player
a.Torso.CFrame = l
wait(3)
script.Parent.Parent.Visible = false
end

script.Parent.MouseButton1Down:connect (b)

_________________________________________________________________________ the variable part is the seat, what the problem is is that the seat gets cloned into the Players Service player instead of the Workspace player. I don't know how to re-write or rather don't know what to do

3 comments

0

all this is taking place inside a gui in a local script

0

just added .Character after LocalPlayer in the player variable declaration see if that works

0

Ok! so yes, professor that worked, but the player doesn't TP to the seat, like the seat is somewhere else in the workspace. I need the player to tp to the seat

1 answer

✓ Accepted answer

I assume you want the part to be placed in the players character.

In this case part.Parent would be player.Character

Hope this helps.

4 comments

0

yes that worked but now i need the player to TP to the seat because the seat is just somewhere in workspace, how would i do this using CFrame?

0

Can you place the seat where the player is already at?

0

Can you accept this answer?

0

To CFrame the part to the characters position you can add this: "part.CFrame = char.Torso.CFrame + char.Torso.CFrame.lookVector * 2" Add this before part.Parent. I tested this in studio and it should work.

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