Bassicaly the skill create a sphere that trap players (caster Will be traped too but he Will have advantage inside)
https://gyazo.com/b268d6bc798d278bea924fab5d1da0ed
But have some problems, the problem is the collision issue, I don’t want the sphere to enter any building, mountain or into another sphere, I tried to use cancollide but it’s not possible to use cancolide and anchored together (if I don’t use anchored the sphere will fall …), so I need a way for the sphere to appear in a place with enough space
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DarkZone = ReplicatedStorage.Skills.Impure.DarkZone.Remotes.DarkZone
local Meshes = script.Meshes
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local trainingm = require(game.ServerStorage.TrainingFiles.TrainingModule)
local function darkZoneF(player)
local interval = 0
local usingSkill = Instance.new("BoolValue")
local colission = false
usingSkill.Name = "usingSkill"
usingSkill.Value = true
usingSkill.Parent = player
print("DARK ZONE")
local Character = player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
local b = Instance.new("BodyPosition")
local bv = Instance.new("BodyVelocity")
local Track = Humanoid:LoadAnimation(script.DZone1)
local ValueA = Track.Length
Track:Play()
local Folder = Instance.new("Folder",workspace)
Folder.Name = player.Name.." DZone"
Folder.Parent = workspace
local mDark = Meshes:WaitForChild("MDarkZone"):Clone()
mDark.CFrame = Character:WaitForChild("LeftHand").CFrame * CFrame.new(0.8,0,-0.1)
mDark.Parent = Folder
mDark.Touched:Connect(function(hit) end)
local weld = Instance.new("WeldConstraint")
weld.Parent = Folder
weld.Part0 = mDark
weld.Part1 = Character:WaitForChild("LeftHand")
wait(1)
local goal = {}
goal.Transparency = mDark.Transparency - 1
local info = TweenInfo.new(0.2)
local tween = TweenService:Create(mDark,info,goal)
tween:Play()
local Track = Humanoid:LoadAnimation(script.DZone2)
Track:Play()
HumanoidRP.Anchored = false
wait(2)
weld:Destroy()
local goal = {}
goal.Size = mDark.Size + Vector3.new(128, 128, 128)
goal.CFrame = mDark.CFrame + Vector3.new(0,128,0)
local info = TweenInfo.new(0.2)
local tween = TweenService:Create(mDark,info,goal)
tween:Play()
tween.Completed:Wait()
mDark.CanCollide = true
while mDark.Parent do
local amount = 0
for _, part in ipairs(mDark:GetTouchingParts()) do
amount = amount + 1
end
if amount == 0 then
print("NOT TOUCHING")
HumanoidRP.CFrame = mDark.CFrame
mDark.Anchored = true
else
print("TOUCHING")
mDark.Anchored = false
interval = 0
end
wait(0.3)
interval = interval + 1
if interval > 3 then
break
end
end
wait(1)
b:Destroy()
end
local function checkEnable(player)
if trainingm.GetTraining(player)["Endurance"] ~= "No" or trainingm.GetTraining(player)["Mind"] == "Auto" or player:FindFirstChild("usingSkill") then
else
player.Character:WaitForChild("HumanoidRootPart").Anchored = true
darkZoneF(player)
end
end
DarkZone.OnServerEvent:Connect(checkEnable)
I tried make that while to anchor the part when part stop touching, but this made the skill very ulgy when appear, see
https://gyazo.com/9bfe437bd462b8297cdf5fa677fa19a7
**I don’t know if you noticed it but it appears inside the other sphere and only after it leaves it, it gets very ugly and can bug (sometimes it goes into the sphere), I want to avoid that: **