#How to change players model when he touches something?
11 messages · Page 1 of 1 (latest)
local modelToSwapIn = game:GetService("InsertService"):LoadAsset(123456):GetChildren()[1] -- Replace 123456 with the Asset ID of the model you want to swap in
function onTouched(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
local player = game.Players:GetPlayerFromCharacter(humanoid.Parent)
if player then
local character = player.Character
if character then
-- Remove the old character model
character:Destroy()
-- Clone the new model and attach it to the player's character
local newCharacter = modelToSwapIn:Clone()
newCharacter.Parent = workspace
player.Character = newCharacter
end
end
end
end
script.Parent.Touched:Connect(onTouched)
@odd kiln
tysm
** You are now Level 1! **