Hey all,
So I am making a game with monsters. Monster #1 is a monster that will kill you if you touch it. It will also destroy your baseparts (humanoidrootpart, torso, legs, arms).
Monster #2 will take you to another dimension if you type something in the chat. Problem is, if monster #1 destroys all your baseparts including humanoidrootpart, Monster #2 cannot teleport you to the dimension, ending with the error.
I NEED it to be humanoidrootpart, not anything else. I have tried making “if - then” statements but they would never ever work. I have also looked on several forums.
So I basically want monster #2 to detect whether there is still a humanoidrootpart in a player or not. I just cant seem to find out what to do!
Here are the scripts.
Monster #1:
local SCP = script.Parent.Parent
local Killsound = script.Parent.Kill
local Killsound2 = script.Parent.Kill2
local Killsound3 = script.Parent.Kill3
local Laugh = script.Parent.Laugh
local Screamer = script.Parent.Screamer
local TargetBrick = script.Parent.Parent.TargetBrick
local Particle = script.Parent.Parent.ParticleBlock.ParticleEmitter
local Killing = script.Parent.Killing
local Sigh1 = SCP.Head.Sigh1
local Sigh2 = SCP.Head.Sigh2
local Sigh3 = SCP.Head.Sigh3
local Sigh4 = SCP.Head.Sigh4
local Sigh5 = SCP.Head.Sigh5
local Sigh6 = SCP.Head.Sigh6
local Sigh7 = SCP.Head.Sigh7
local Sigh8 = SCP.Head.Sigh8
--Badge
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local IDToAward = 2140861943
local Attacking = false
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) and humanoid.Health > 0 and Attacking == false then
Attacking = true
Killing.Value = true
local Player = Players:GetPlayerFromCharacter(humanoid.Parent)
if Player and not BadgeService:UserHasBadgeAsync(Player.UserId, IDToAward) then
BadgeService:AwardBadge(Player.UserId, IDToAward)
print("Awarded ENCLOSED Badge to victim")
else if BadgeService:UserHasBadgeAsync(Player.UserId, IDToAward) then
print("Not a player or already has the badge")
end
end
local KillSoundRandomizer = math.random(1,3)
if KillSoundRandomizer == 1 then
SCP017.WalkSpeed = 0
Killsound:Play()
wait(.3)
Screamer:Play()
humanoid.Health = 0
humanoid.BreakJointsOnDeath = false
wait(.1)
Particle.Size = NumberSequence.new(2,3)
wait(.1)
humanoid.Parent.HumanoidRootPart.CFrame = SCP017.Parent.HumanoidRootPart.CFrame
Particle.Size = NumberSequence.new(3,4)
wait(.1)
Particle.Size = NumberSequence.new(4,5)
wait(.1)
Particle.Size = NumberSequence.new(5,6)
wait(.1)
Particle.Size = NumberSequence.new(6,7)
if humanoid then -- if Humanoid Exists
for _,i in humanoid.Parent:GetDescendants() do -- iterates through Character
if not i:IsA("Humanoid") then -- if Instances arent a Humanoid
i:Destroy() -- Destroys Instances
end
end
end
wait(7)
local Randomizer = math.random(1,8)
if Randomizer == 1 then
Sigh1:Resume()
print("017 Taunt #1")
elseif Randomizer == 2 then
Sigh2:Resume()
print("017 Taunt #2")
elseif Randomizer == 3 then
Sigh3:Resume()
print("017 Taunt #3")
elseif Randomizer == 4 then
Sigh4:Resume()
print("017 Taunt #4")
elseif Randomizer == 5 then
Sigh5:Resume()
print("017 Taunt #5")
elseif Randomizer == 6 then
Sigh6:Resume()
print("017 Taunt #6")
elseif Randomizer == 7 then
Sigh7:Resume()
print("017 Taunt #7")
elseif Randomizer == 8 then
Sigh8:Resume()
print("017 Taunt #8")
end
wait(2)
Particle.Size = NumberSequence.new(6,6)
wait(.01)
Particle.Size = NumberSequence.new(5,5)
wait(.01)
Particle.Size = NumberSequence.new(4,4)
wait(.01)
Particle.Size = NumberSequence.new(3,3)
wait(.01)
Particle.Size = NumberSequence.new(2,2)
wait(.01)
SCP017.WalkSpeed = 50
end
if KillSoundRandomizer == 2 then
SCP017.WalkSpeed = 0
Killsound2:Play()
Screamer:Play()
humanoid.Health = 0
humanoid.BreakJointsOnDeath = false
wait(.1)
Particle.Size = NumberSequence.new(2,3)
wait(.1)
humanoid.Parent.HumanoidRootPart.CFrame = SCP017.Parent.HumanoidRootPart.CFrame
Particle.Size = NumberSequence.new(3,4)
wait(.1)
Particle.Size = NumberSequence.new(4,5)
wait(.1)
Particle.Size = NumberSequence.new(5,6)
wait(.1)
Particle.Size = NumberSequence.new(6,7)
if humanoid then -- if Humanoid Exists
for _,i in humanoid.Parent:GetDescendants() do -- iterates through Character
if not i:IsA("Humanoid") then -- if Instances arent a Humanoid
i:Destroy() -- Destroys Instances
end
end
end
wait(1)
local Randomizer = math.random(1,8)
if Randomizer == 1 then
Sigh1:Resume()
print("017 Taunt #1")
elseif Randomizer == 2 then
Sigh2:Resume()
print("017 Taunt #2")
elseif Randomizer == 3 then
Sigh3:Resume()
print("017 Taunt #3")
elseif Randomizer == 4 then
Sigh4:Resume()
print("017 Taunt #4")
elseif Randomizer == 5 then
Sigh5:Resume()
print("017 Taunt #5")
elseif Randomizer == 6 then
Sigh6:Resume()
print("017 Taunt #6")
elseif Randomizer == 7 then
Sigh7:Resume()
print("017 Taunt #7")
elseif Randomizer == 8 then
Sigh8:Resume()
print("017 Taunt #8")
end
wait(2)
Particle.Size = NumberSequence.new(6,6)
wait(.01)
Particle.Size = NumberSequence.new(5,5)
wait(.01)
Particle.Size = NumberSequence.new(4,4)
wait(.01)
Particle.Size = NumberSequence.new(3,3)
wait(.01)
Particle.Size = NumberSequence.new(2,2)
wait(.01)
SCP017.WalkSpeed = 50
end
if KillSoundRandomizer == 3 then
SCP017.WalkSpeed = 0
Killsound3:Play()
Screamer:Play()
humanoid.Health = 0
humanoid.BreakJointsOnDeath = false
wait(.1)
Particle.Size = NumberSequence.new(2,3)
wait(.1)
humanoid.Parent.HumanoidRootPart.CFrame = SCP017.Parent.HumanoidRootPart.CFrame
Particle.Size = NumberSequence.new(3,4)
wait(.1)
Particle.Size = NumberSequence.new(4,5)
wait(.1)
Particle.Size = NumberSequence.new(5,6)
wait(.1)
Particle.Size = NumberSequence.new(6,7)
if humanoid then -- if Humanoid Exists
for _,i in humanoid.Parent:GetDescendants() do -- iterates through Character
if not i:IsA("Humanoid") then -- if Instances arent a Humanoid
i:Destroy() -- Destroys Instances
end
end
end
wait(5)
local Randomizer = math.random(1,8)
if Randomizer == 1 then
Sigh1:Resume()
print("017 Taunt #1")
elseif Randomizer == 2 then
Sigh2:Resume()
print("017 Taunt #2")
elseif Randomizer == 3 then
Sigh3:Resume()
print("017 Taunt #3")
elseif Randomizer == 4 then
Sigh4:Resume()
print("017 Taunt #4")
elseif Randomizer == 5 then
Sigh5:Resume()
print("017 Taunt #5")
elseif Randomizer == 6 then
Sigh6:Resume()
print("017 Taunt #6")
elseif Randomizer == 7 then
Sigh7:Resume()
print("017 Taunt #7")
elseif Randomizer == 8 then
Sigh8:Resume()
print("017 Taunt #8")
end
wait(2)
Particle.Size = NumberSequence.new(6,6)
wait(.01)
Particle.Size = NumberSequence.new(5,5)
wait(.01)
Particle.Size = NumberSequence.new(4,4)
wait(.01)
Particle.Size = NumberSequence.new(3,3)
wait(.01)
Particle.Size = NumberSequence.new(2,2)
wait(.01)
SCP017.WalkSpeed = 50
end
Killing.Value = false
Attacking = false
end
end
script.Parent.Touched:connect(onTouch)
Monster #2:
local Occupied = false
local NoCommunication
local Stinger
function clone2521()
local SCP2521 = game.ServerStorage.SCP2521:Clone()
SCP2521.Parent = game.workspace
end
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
for i = 1, #triggerwords do
local word = triggerwords[i]
local matchcheck = string.match(msg, word)
if matchcheck ~= nil and Occupied == false then
Occupied = true
if word == "SCP2521" or "SCP-2521" or "SCP 2521" or "2521" or "2 5 2 1" or "two thousand five hundred twenty one" or "Twenty Five Twenty One" or "twenty five twenty one" or "Two Five Two One" or "two five two one" or "TwoFiveTwoOne" or "twofivetwoone" or "TwentyFiveTwentyOne" or "TwoThousandFiveHundredTwentyOne" or "Two Thousand Five Hundred Twenty One" then
local victim = plr.Character
clone2521()
victim.Humanoid.WalkSpeed = 0
victim.HumanoidRootPart.Anchored = true
wait(math.random(2,3))
workspace.SCP2521.Head.Music:Play()
workspace.SCP2521.PlayAnimation.Disabled = false
local LastTargetPosition = victim.HumanoidRootPart.CFrame
local LookLength = -3
workspace.SCP2521.HumanoidRootPart.CFrame = LastTargetPosition + LastTargetPosition.LookVector * LookLength
workspace.SCP2521.HumanoidRootPart.CFrame = CFrame.new(workspace.SCP2521.HumanoidRootPart.CFrame.Position, Vector3.new(LastTargetPosition.Position.X, workspace.SCP2521.HumanoidRootPart.CFrame.Position.Y, LastTargetPosition.Position.Z))
local Scream = workspace.SCP2521.Head.Scream
wait(3.86)
victim.HumanoidRootPart.CFrame = workspace.SCP2521.TakenSpot.CFrame
wait(.3)
Scream:Play()
function Stinger()
local SCP = workspace.SCP2521.HumanoidRootPart
local Stinger = game.ServerStorage.Stinger:Clone()
Stinger.Parent = workspace
Stinger.CFrame = SCP.CFrame
end
Stinger()
wait(.2)
victim.HumanoidRootPart.CFrame = workspace.AreaOfInfinity.TeleportPartToGlitchedReality.CFrame
function NoCommunication()
local GoneScript = game.ServerStorage.GoneScript2521:Clone()
GoneScript.Parent = victim
GoneScript.Enabled = true
end
NoCommunication()
victim.HumanoidRootPart.Anchored = false
victim.Humanoid.WalkSpeed = 7.5
workspace.SCP2521:Destroy()
wait(1)
Occupied = false
end
end
end
end)
end)
I sincerely apologize for the messy/atrociously long code. I’m a newbie scripter, haha.
