Hello scriptinghelpers users. I'm working on a project based off a game called Deceit in steam, I've got the round and blood drinking system working fine, but my monster morphing isn't working properly, but before let me explain what I'm trying to do. So the game deceit has 4 survivors and 2 infected, the infected gotta drink blood (I've done that) and press G to transform, but when it transforms it morphs outside the map so I tried to make the player teleport to the old location but didn't work well, if someone can help me throught here or discord I would be so much appreaciated.
local script:
uis.InputBegan:Connect(function(key, gameProcessed)
if key.KeyCode == Enum.KeyCode.G then
print("player pressed key G")
if isFull.Value == true then
print("player is full blood, so lets fire the transform remote.")
local character = player.Character or player.CharacterAdded:Wait()
local torso = character.HumanoidRootPart.CFrame
transformRemote:FireServer(player, torso)
end
end
end)
server script:
transformRemote.OnServerEvent:Connect(function(player, isFull, playerCFrame)
if player and isFull then
print(playerCFrame)
--morphing part
local charClone = monster:Clone()
charClone.Name = player.Name
player.Character = charClone
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = player:FindFirstChild("HumanoidRootPart") or player:FindFirstChild("Torso")
if rootPart and plrRoot then
rootPart.CFrame = plrRoot.CFrame
end
charClone.Parent = workspace
rootPart.CFrame = playerCFrame
wait(.5)
end
end)
It morphs to the monster perfectly but it spawn outside the map and I wanted it to spawn in the player location before morphing. Error: invalid arguement #3 (CFrame expected, got Instance) line 24
Thank you.
