-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathHardcoreItemRemoval.lua
More file actions
39 lines (35 loc) · 893 Bytes
/
HardcoreItemRemoval.lua
File metadata and controls
39 lines (35 loc) · 893 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
38
39
local function hasItem90000(player)
return player:GetItemCount(90000) > 0
end
-- Remove custom starter items
local function removeItems(player)
local removed = false
local items = {60002, 10594, 65000}
for _, entry in ipairs(items) do
local itemCount = player:GetItemCount(entry)
if itemCount > 0 then
for i = 0, itemCount - 1 do
player:RemoveItem(entry, 1)
end
removed = true
end
end
return removed
end
-- Remove Murky
local function removeSpell(player)
player:RemoveSpell(24939)
player:RemoveSpell(100117)
player:RemoveSpell(100118)
end
-- Script body
local function onLogin(event, player)
if hasItem90000(player) then
if removeItems(player) then
player:SendBroadcastMessage("Welcome to Hardcore Mode. Please watch your step!")
end
removeSpell(player)
end
end
-- Register the script to be triggered on player login
RegisterPlayerEvent(3, onLogin)