I’am making a skill called Dark Zone
1. The skill create a small sphere on your hands, while you hold the mouse
2. When you stop hold the small sphere Will grow to trap the players around (of course is a hollow sphere)
3. Enemys cant leave from the sphere, and the caster (the player that actived the skill) have a good mobility if he goes in the corner < he will be teleported to the corner > (this with all angles)
I started but iam having that problem:
https://gyazo.com/bcdb8c3cc5f4bd2767721e2a5896c45a
As you can see I’m thrown out of the sphere (even though it’s hollow), I thought about removing the anchor but I don’t want the sphere to get stuck in any building or on the ground, I’ve been trying for a long time, here’s the code:
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 usingSkill = Instance.new("BoolValue")
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 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
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()
mDark.CanCollide = true
local goal = {}
goal.Size = mDark.Size + Vector3.new(170, 185, 185)
local info = TweenInfo.new(0.2)
local tween = TweenService:Create(mDark,info,goal)
tween:Play()
tween.Completed:Wait()
mDark.Anchored = true
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)