Hello There!
I’m creating a game where Robloxians must defend a statue symbolizing Old Roblox againt Roblox Administrators as a way to mock the “BRING BACK OLD ROBLOX” phase.
Anyway, I’ve originally decided to use Tools for the administrator abilities although scrapped it since it felt unprofessional. I’ve found a video which explains how to make a pretty decent skill system although I wanted to improve it since it feels beginner-like.
To get things started, there is a RemoteEvent called “AbilityEvent”, this allows the player to do their skills.
This is the local script called “AbiltieisController”, this is placed inside of the player and as the name says, “controls” the abilties.
--//Character\\--
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
--//Services\\--
local UIS = game:GetService("UserInputService")
--//Abilities\\--
local AbilityEvent = game:GetService("ReplicatedStorage"):WaitForChild("AbilityRemote")
local DB = false
UIS.InputBegan:Connect(function(Input, gameProcessedEvent)
if Input.UserInputType == Enum.UserInputType.MouseButton1 and DB == false then
DB = true
AbilityEvent:FireServer("SwordSwing")
task.wait(1.2)
DB = false
end
end)
UIS.InputBegan:Connect(function(Input, gameProcessedEvent)
if Input.KeyCode == Enum.KeyCode.Q and DB == false then
DB = true
AbilityEvent:FireServer("SwordSwitch")
task.wait(.08)
DB = false
end
end)
This is a server script in ServerScriptServices, this makes the skills do something.
--//Services\\--
local RP = game:GetService("ReplicatedStorage")
local DB = game:GetService("Debris")
--//Anims\\--
local SwingAnim = script:WaitForChild("SwingAnim")
--//Functions\\--
local CanDamage = false
local AbilityController = RP:WaitForChild("AbilityRemote")
AbilityController.OnServerEvent:Connect(function(Plr,AbilityType)
local SwordTypeID = 1
if AbilityType == "SwordSwing" then
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local SwordType = Char:GetAttribute("SwordType")
local SwordTrail = Char.Sword:WaitForChild("SwordTrail")
local SwingSound = Char.Sword:WaitForChild("SwordSlash")
local Humanoid = Char:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
SwordTrail.Enabled = true
CanDamage = true
local SwingTrack = Animator:LoadAnimation(SwingAnim)
SwingTrack:Play()
SwingSound:Play()
Char.Sword.Touched:Connect(function(OnHit)
local Humanoid = OnHit.Parent:WaitForChild("Humanoid")
if Humanoid and CanDamage == true then
CanDamage = false
if SwordType == "Linked" then
Humanoid:TakeDamage(35)
end
if SwordType == "Firebrand" then
Humanoid:TakeDamage(25)
if Humanoid.Parent:GetAttribute("CanBeSetOnFire") == true then
local DOTDmg = coroutine.create(function()
while true do
Humanoid:TakeDamage(3.5)
task.wait(0.3)
end
end)
for _, Bodypart in pairs(Humanoid.Parent:GetChildren()) do
if Bodypart:IsA("BasePart") then
local Fire = script:WaitForChild("Fire"):Clone()
DB:AddItem(Fire,5)
Fire.Parent = Bodypart
Fire.Enabled = true
end
end
coroutine.resume(DOTDmg)
task.wait(2.5)
coroutine.close(DOTDmg)
else
print("CAN'T BE SET ON FIRE SINCE 2 C00L 4 ADMINS")
end
end
if SwordType == "Venomshank" then
Humanoid:TakeDamage(8.5)
local DOTDmg = coroutine.create(function()
while true do
Humanoid:TakeDamage(0.5)
task.wait(0.1)
end
end)
local PoisonEffect = script:WaitForChild("PoisonEffect"):Clone()
game:GetService("Debris"):AddItem(PoisonEffect,8.1)
PoisonEffect.Parent = Humanoid.Parent.PrimaryPart
PoisonEffect.Enabled = true
coroutine.resume(DOTDmg)
task.wait(15)
coroutine.close(DOTDmg)
end
end
end)
SwingTrack.Stopped:Wait()
SwordTrail.Enabled = false
CanDamage = false
end
if AbilityType == "SwordSwitch" then
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Sword = Char:WaitForChild("Sword")
local SwordMesh = Sword:WaitForChild("Mesh")
SwordTypeID += 1
if SwordTypeID == 2 then
Char:SetAttribute("SwordType", "Firebrand")
SwordMesh.VertexColor = Vector3.new(0.5, 0, 0)
end
if SwordTypeID == 3 then
Char:SetAttribute("SwordType", "Venomshank")
SwordMesh.VertexColor = Vector3.new(0.3, 1, 0.3)
end
if SwordTypeID == 4 then
Char:SetAttribute("SwordType", "Linked")
SwordMesh.VertexColor = Vector3.new(1,1,1)
SwordTypeID = 1
end
end
end)
MAIN GOALS
- I’m trying to make the skill system a bit more diverse as I’m adding other playable characters when your in the Administrator team, so I’d need to change the script so it includes all of the playable administrators attacks without having to clutter the script too much and avoiding using multiple scripts for the weapon.
- How can I make it so that after the skill is done doing whatever, it goes on cooldown.