So I was trying to make you copy the same appearance of the player the mouse is on when you press Q.
IN ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Trans = ReplicatedStorage.Quinl.Transformar
function transformar(plr, plr2)
plr.CharacterAppearanceId = plr2.UserId
plr:LoadCharacter()
end
Trans.OnServerEvent:Connect(transformar)
Local Script
plr = game.Players.LocalPlayer
Rep = game:GetService("ReplicatedStorage")
Trans = Rep.Quinl.Transformar
local UIS = game:GetService("UserInputService")
mouse = plr:GetMouse()
UIS.InputBegan:Connect(function(inputObject)
if(inputObject.KeyCode==Enum.KeyCode.Q)then
if mouse and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:IsA("Model") then
local plr2 = game.Players:GetPlayerFromCharacter(mouse.Target.Parent)
if plr2 then
Trans:FireServer(plr2)
end
end
end
end)
No matter what I try the character does not change.
Any help? Haven#2692

2 comments
psst KeyDown is deprecated use UserInputService, also use GetService instead of indexing DataModel
^