-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathactivate_abilities.lua
More file actions
37 lines (35 loc) · 969 Bytes
/
activate_abilities.lua
File metadata and controls
37 lines (35 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- abilities can be activated regardless if they unlocked it or not
local foryouonly = true
local farmonly = true
function activate(v)
local args = {
[1] = v,
[2] = v.Abilities.AbilityID
}
game:GetService("ReplicatedStorage").AbilityEvent:FireServer(unpack(args))
end
for i,v in pairs(game.Workspace.Towers:GetChildren()) do
if foryouonly then
if farmonly then
if v.Name == "Server Farm" and v.Owner.Value == game.Players.LocalPlayer.Name then
activate(v)
end
else
if v.Owner.Value == game.Players.LocalPlayer.Name then
pcall(function()
activate(v)
end)
end
end
else
if farmonly then
if v.Name == "Server Farm" then
activate(v)
end
else
pcall(function()
activate(v)
end)
end
end
end