Essentially, what I have right now is a teleport script
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local RootPart = Character:WaitForChild("HumanoidRootPart")
local TargetPosition = Vector3.new(-16.225, 0.555, 34.677) --Replace this with the position you want the player to move to.
RootPart.CFrame = CFrame.new(TargetPosition)
However, this operates the character on the server side as well so it is no good, I’d appreciate if anybody was able to help.
The post suggested to clone the character and teleport the clone instead. Why not do that? (Make sure to set the character’s Archivable to true first, so you can clone it)
character.Archivable = true -- By default roblox sets this to false. Without this you cant clone.
local clone = character:Clone()
clone.Parent = workspace
clone:SetPrimaryPartCFrame(CFrame.new(TargetPosition))
I meant more the events, such as if you clicked on something that equipped onto your character how you would replicate that to the clone and the character.
You would use remotes. When you click a button, you fire a remote with the name of the thing you want to equip. You then clone the helmet to the fake character and the real one.
button.Activated:Connect(function()
local item = folder[item.Name]
item:Clone().Parent = clone
remote:FireServer(button.Name)
end)
folder would likely be some folder in replicated storage with all your items. The button name would be the same as the thing you want to equip.
Do you know how I would implement the character wait into my script so that as soon as the character is loaded they are cloned and the clone is teleported.
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local RootPart = Character:WaitForChild("HumanoidRootPart")
local clone = Character:Clone()
local TargetPosition = Vector3.new(-16.225, 5.085, 34.677) --Replace this with the position you want the player to move to.
Character.Archivable = true -- By default roblox sets this to false. Without this you cant clone.
clone.Parent = workspace
clone:SetPrimaryPartCFrame(CFrame.new(TargetPosition))
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() -- :wait is deprecated use :Wait
Character.Archivable = true
local RootPart = Character:WaitForChild("HumanoidRootPart")
local clone = Character:Clone()
local TargetPosition = Vector3.new(-16.225, 5.085, 34.677) --Replace this with the position you want the player to move to.
clone.Parent = workspace
clone:SetPrimaryPartCFrame(CFrame.new(TargetPosition))
Also, I’m trying to implement that LocalScript code you gave earlier on.
button.Activated:Connect(function()
local item = folder[item.Name]
item:Clone().Parent = clone
remote:FireServer(button.Name)
end)
However, I’ve slightly edited it.
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAppearanceLoaded:Wait()
local clone = Character:Clone()
function OnClick()
local item = game.ReplicatedStorage.meshes.Webbing.Webbing
item:Clone().Parent = clone
end
script.Parent.MouseButton1Click:connect(OnClick)
But, this isn’t working. I’m guessing it has something to do with the clone bit - trying to identify what the clone is - any help?