[DiscordArchive] I am very new at Lua scripting, can someone see...
[DiscordArchive] I am very new at Lua scripting, can someone see...
Archived author: Exced™ • Posted: 2025-01-05T21:08:16.766000+00:00
Original source
https://tenor.com/view/an-absolute-legen...f-23577458
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
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
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
```
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
```
Archived author: Exced™ • Posted: 2025-01-05T21:50:44.175000+00:00
Original source
good to know ty for info!
Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:51:48.316000+00:00
Original source
His 3's refer to 3 of these ` ``` `
Archived author: [GLFY] Mitche • Posted: 2025-01-05T21:52:01.662000+00:00
Original source
` ```lua`
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 ` ``` `
Archived author: Exced™ • Posted: 2025-01-05T21:56:33.726000+00:00
Original source
```indeed```