Forums WoW Modding Support Archives WoWModding Threads [DiscordArchive] I am very new at Lua scripting, can someone see...

[DiscordArchive] I am very new at Lua scripting, can someone see...

[DiscordArchive] I am very new at Lua scripting, can someone see...

Pages (4): Previous 1 2 3 4 Next
rektbyfaith
Administrator
0
01-05-2025, 09:08 PM
#21
Archived author: Exced™ • Posted: 2025-01-05T21:08:16.766000+00:00
Original source

https://tenor.com/view/an-absolute-legen...f-23577458
rektbyfaith
01-05-2025, 09:08 PM #21

Archived author: Exced™ • Posted: 2025-01-05T21:08:16.766000+00:00
Original source

https://tenor.com/view/an-absolute-legen...f-23577458

rektbyfaith
Administrator
0
01-05-2025, 09:10 PM
#22
Archived author: Revanas • Posted: 2025-01-05T21:10:12.761000+00:00
Original source

I thought it would be some good practice with lua and tools, might be an easyer way
rektbyfaith
01-05-2025, 09:10 PM #22

Archived author: Revanas • Posted: 2025-01-05T21:10:12.761000+00:00
Original source

I thought it would be some good practice with lua and tools, might be an easyer way

rektbyfaith
Administrator
0
01-05-2025, 09:10 PM
#23
Archived author: Exced™ • Posted: 2025-01-05T21:10:40.077000+00:00
Original source

as far as i know this is as easy as it gets
rektbyfaith
01-05-2025, 09:10 PM #23

Archived author: Exced™ • Posted: 2025-01-05T21:10:40.077000+00:00
Original source

as far as i know this is as easy as it gets

rektbyfaith
Administrator
0
01-05-2025, 09:41 PM
#24
Archived author: stoneharry • Posted: 2025-01-05T21:41:42.261000+00:00
Original source

fyi you can paste the code into Discord surrounded by three ` characters

i.e:
3`
code
3`

and you can syntax highlight it too:

3`lua

3`

(3` to avoid Discord parsing it)

```lua
code
```
rektbyfaith
01-05-2025, 09:41 PM #24

Archived author: stoneharry • Posted: 2025-01-05T21:41:42.261000+00:00
Original source

fyi you can paste the code into Discord surrounded by three ` characters

i.e:
3`
code
3`

and you can syntax highlight it too:

3`lua

3`

(3` to avoid Discord parsing it)

```lua
code
```

rektbyfaith
Administrator
0
01-05-2025, 09:45 PM
#25
Archived author: stoneharry • Posted: 2025-01-05T21:45:31.956000+00:00
Original source

try this:
```lua

local SPELL = {
Judgement = 800001,
BuffSealRighteousness = 21084,
JudgementRighteousness = 21087,
}

-- Event triggered when a spell is cast
local function OnSpellCast(event, player, spell, skipCheck)
player:SendBroadcastMessage("You cast: "..tostring(spell:GetEntry())) -- FIXME: Debugging, delete
-- Check if the spell cast is Judgement
if spell:GetEntry() ~= SPELL.Judgement then
return
end
-- Check if the player has the Seal of Righteousness buff
if not(player:HasAura(SPELL.BuffSealRighteousness)) then
return
end
-- Cast Judgement of Righteousness on the target
local target = player:GetVictim() -- Use GetVictim to get the player's target
player:SendBroadcastMessage("Got target: "..tostring(target)) -- FIXME: Debugging, delete
if target and target:IsAlive() then
player:SendBroadcastMessage("Casting spell!") -- FIXME: Debugging, delete
player:CastSpell(target, SPELL.JudgementRighteousness)
-- Remove the Seal of Righteousness buff from the player
player:RemoveAura(SPELL.BuffSealRighteousness)
end
end

-- Register the event for spell cast
RegisterPlayerEvent(5, OnSpellCast) -- Event 5 corresponds to spell cast events
```
rektbyfaith
01-05-2025, 09:45 PM #25

Archived author: stoneharry • Posted: 2025-01-05T21:45:31.956000+00:00
Original source

try this:
```lua

local SPELL = {
Judgement = 800001,
BuffSealRighteousness = 21084,
JudgementRighteousness = 21087,
}

-- Event triggered when a spell is cast
local function OnSpellCast(event, player, spell, skipCheck)
player:SendBroadcastMessage("You cast: "..tostring(spell:GetEntry())) -- FIXME: Debugging, delete
-- Check if the spell cast is Judgement
if spell:GetEntry() ~= SPELL.Judgement then
return
end
-- Check if the player has the Seal of Righteousness buff
if not(player:HasAura(SPELL.BuffSealRighteousness)) then
return
end
-- Cast Judgement of Righteousness on the target
local target = player:GetVictim() -- Use GetVictim to get the player's target
player:SendBroadcastMessage("Got target: "..tostring(target)) -- FIXME: Debugging, delete
if target and target:IsAlive() then
player:SendBroadcastMessage("Casting spell!") -- FIXME: Debugging, delete
player:CastSpell(target, SPELL.JudgementRighteousness)
-- Remove the Seal of Righteousness buff from the player
player:RemoveAura(SPELL.BuffSealRighteousness)
end
end

-- Register the event for spell cast
RegisterPlayerEvent(5, OnSpellCast) -- Event 5 corresponds to spell cast events
```

rektbyfaith
Administrator
0
01-05-2025, 09:50 PM
#26
Archived author: Exced™ • Posted: 2025-01-05T21:50:44.175000+00:00
Original source

good to know ty for info!
rektbyfaith
01-05-2025, 09:50 PM #26

Archived author: Exced™ • Posted: 2025-01-05T21:50:44.175000+00:00
Original source

good to know ty for info!

rektbyfaith
Administrator
0
01-05-2025, 09:51 PM
#27
Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:51:48.316000+00:00
Original source

His 3's refer to 3 of these ` ``` `
rektbyfaith
01-05-2025, 09:51 PM #27

Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:51:48.316000+00:00
Original source

His 3's refer to 3 of these ` ``` `

rektbyfaith
Administrator
0
01-05-2025, 09:52 PM
#28
Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:52:01.662000+00:00
Original source

` ```lua`
rektbyfaith
01-05-2025, 09:52 PM #28

Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:52:01.662000+00:00
Original source

` ```lua`

rektbyfaith
Administrator
0
01-05-2025, 09:52 PM
#29
Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:52:12.398000+00:00
Original source

then code after followed by another will provide color like his ` ``` `
rektbyfaith
01-05-2025, 09:52 PM #29

Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:52:12.398000+00:00
Original source

then code after followed by another will provide color like his ` ``` `

rektbyfaith
Administrator
0
01-05-2025, 09:56 PM
#30
Archived author: Exced™ • Posted: 2025-01-05T21:56:33.726000+00:00
Original source

```indeed```
rektbyfaith
01-05-2025, 09:56 PM #30

Archived author: Exced™ • Posted: 2025-01-05T21:56:33.726000+00:00
Original source

```indeed```

Pages (4): Previous 1 2 3 4 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)