I created that skill:
https://gyazo.com/b90aaceee41e3fcfaa67b8b772623fc6
the skill holds all the players around you within that sphere, and stun them and silence them (you cannot use skill while silenced) and the skill makes you “unstoppable” (you cannot be stunned)
so for that I created a module for the effects and a module to activate each effect
That module have all effects on table:
local Effects = {}
local module = {}
function module.New(c)
return {
["Stunned"] = nil;
["Silenced"] = nil;
["Traped"] = nil;
["Unstoppable"] = nil
}
end
function module.Get(c, effect)
if not Effects[c] then
return nil
else
return Effects
end
end
function module.Set(c,c2,effect)
if Effects[c] == nil then
Effects[c] = module.New(c)
end
Effects[c][""..effect] = c2
end
function module.Remove(c,effect)
for index = 1, #Effects do
if Effects[index][""..effect] == c then
Effects[index][""..effect].Value = nil
end
end
end
return module
The key in the table Effects is the character of the player, and the values are the character of the player that caused the effect
And that is the module that Stun the player:
local StunEvent = game.ServerStorage.Events.Stun
local Effects = game.ServerStorage.Effects
local Stun = game.ServerStorage.Events.Stun
local module = {}
function module.Check(character)
if Effects.Get(character,"Unstoppable") or Effects.Get(character,"Traped") or Effects.Get(character,"Stunned") then
return false
else
return true
end
end
function module.StunPlayersAround(character,distance,Time)
local p = game.Players:GetPlayers()
local list = {}
for i = 1, #p do
local c = p[i].Character
if character ~= c and module.Check(c) == true and c:DistanceFromCharacter(character) <= distance then
Effects.Set(c,character,"Stunned")
c:WaitForChild("HumanoidRootPart").Anchored = true
Stun:Fire(c)
table.insert(list,c)
if Time > 0 then
module.RemoveStun(c,Time)
end
end
end
return list
end
function module.RemoveStun(character,Time)
wait(Time)
Effects.Remove(character,"Stunned")
end
return module
And the silence one:
local Effects = game.ServerStorage.Effects
local module = {}
function module.Check(character)
if Effects.Get(character,"Silenced") or Effects.Get(character,"Unstoppable") then
return false
else
return true
end
end
function module.SilencePlayersAround(character,distance,Time)
local p = game.Players:GetPlayers()
for i = 1, #p do
local c = p[i].Character
if character ~= c and module.Check(c) == true and c:DistanceFromCharacter(character) <= distance then
Effects.Set(c,character,"Silenced")
if Time > 0 then
module.RemoveSilence(c,Time)
end
end
end
end
function module.RemoveSilence(character,Time)
wait(Time)
Effects.Remove(character,"Silenced")
end
return module
For some reason the fact that I use module.RemoveStun or module.RemoveSilence is destroying the character of the player
I know because i teste if i remove that line
and that
stop destroying the caracter, idk why this is happen, make no sense for me,
I thought that was it
function module.Remove(c,effect)
for index = 1, #Effects do
if Effects[index][""..effect] == c then
Effects[index][""..effect].Value = nil -- I thought this was removing the character
from the player not only from the table
but also from the game, but I removed
that line and it remains the same
end
end
end
That IS skill script
I made a lot of tests and that still making no sense for me, i dont have idea what to do, that is the copy if you guys want try, only press F to use the skill, please anyone smart enought helpme Again.rbxl (4.9 MB)