This sanity check activates when the player touches the killblock(“GoldTrussFireEffect”).
I never made one before so I really don’t know if I’m doing it right or making a terrible mistake to my game.
This isn’t the whole script, and it’s located in ServerScriptService.
Thanks for reading my post. Any feedback would be very appreciated.
local nameValidationProcedures = {
["GoldTrussFireEffect"] = function(part, humanoid, player)
local correctColor = Color3.fromRGB(149, 141, 33)
local correctShape = Enum.PartType.Ball
local correctMaterial = Enum.Material.Salt
local correctTransparency = 1
local correctReflectance = 0
local correctSize = Vector3.new(4, 4, 4)
local canCollide = true
local canTouch = true
local canQuery = true
local castShadow = false
if part.Color ~= correctColor then
kickPlayer(player)
return
elseif part.Shape ~= correctShape then
kickPlayer(player)
return
elseif part.Material ~= correctMaterial then
kickPlayer(player)
return
elseif part.Transparency ~= correctTransparency then
kickPlayer(player)
return
elseif part.Reflectance ~= correctReflectance then
kickPlayer(player)
return
elseif part.Size ~= correctSize then
kickPlayer(player)
return
elseif part.Anchored ~= true then
kickPlayer(player)
return
elseif part.CanCollide ~= canCollide then
kickPlayer(player)
return
elseif part.CanTouch ~= canTouch then
kickPlayer(player)
return
elseif part.CanQuery ~= canQuery then
kickPlayer(player)
return
elseif part.CastShadow ~= castShadow then
kickPlayer(player)
return
end
kickPlayer(player)
local hasFire = false
local hasTouchInterest = false
for _, child in pairs(part:GetChildren()) do
if child:IsA("Fire") then
hasFire = true
elseif child:IsA("TouchTransmitter") then
hasTouchInterest = true
end
end
if not hasFire then
kickPlayer(player)
return
elseif not hasTouchInterest then
kickPlayer(player)
return
end
local fire = part:FindFirstChildOfClass("Fire")
local fireColor = Color3.fromRGB(236, 139, 70)
local fireSecondaryColor = Color3.fromRGB(139, 80, 55)
local fireHeat = 25
local fireSize = 25
if fire.Color ~= fireColor then
kickPlayer(player)
return
elseif fire.SecondaryColor ~= fireSecondaryColor then
kickPlayer(player)
return
elseif fire.Heat ~= fireHeat then
kickPlayer(player)
return
elseif fire.Size ~= fireSize then
kickPlayer(player)
return
end
humanoid.Health = 0
end,
}