#how to fix character switch?

1 messages · Page 1 of 1 (latest)

hardy rose
#

local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")

local PartBrick = script.Parent
local guyModel = Workspace:FindFirstChild("Guy")

local prompt = PartBrick:FindFirstChildOfClass("ProximityPrompt")
if not prompt then
prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Become Guy"
prompt.ObjectText = "Transform"
prompt.HoldDuration = 0.5
prompt.Parent = PartBrick
end

prompt.Triggered:Connect(function(player)
if not guyModel then
warn("Guy model not found in Workspace!")
return
end

local character = player.Character
if not character then return end

local root = character:FindFirstChild("HumanoidRootPart")
if not root then return end

local newChar = guyModel:Clone()
newChar.Name = player.Name

if newChar:FindFirstChild("HumanoidRootPart") then
    newChar:PivotTo(root.CFrame)
else
    
    local firstPart
    for _, obj in newChar:GetChildren() do
        if obj:IsA("BasePart") then
            firstPart = obj
            break
        end
    end
    if firstPart then
        firstPart.CFrame = root.CFrame
    end
end

newChar.Parent = Workspace

player.Character = newChar
task.wait(0.1)
if character and character.Parent then
    character:Destroy()
end

end)

#

(i used AI for like 90% of this)

formal kayak
#

local rs = game.["Run Service"]
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local camera = workspace.CurrentCamera

local humanoid = char:WaitForChild("Humanoid")

rs.RenderStepped:Connect(function()
camera.CameraSubject = humanoid
end)

atomic hamletBOT
#

studio** You are now Level 11! **studio

formal kayak