What I’m trying to achieve here is the usage of spells through module scripts. What my problem is i don’t know how to make it so if you say the spell “Incendia” it does what’s in the module script (Second Code) I’ve just started to learn a bout module scripts so i’m stuck on this. If you need more clarification i will provide
local ReplicatedStorage = game.ReplicatedStorage
local Storage = ReplicatedStorage.SpellsModules
local Spells = {
["Incendia"] =
{
Launch = Storage.Incendia,
Input = Enum.UserInputType.MouseButton1,
Cooldown = 8,
Spell= "Incendia",
Magnitude = 30,
Magic = 60,
},
}
return Spells
local Code = {}
local Players = game.Players
local ReplicatedStorage = game.ReplicatedStorage
local Modules = ReplicatedStorage.RModules
local TweenModule = require(Modules.Tweening)
local Assets = ReplicatedStorage.ReplicatedAssets
local WitchFolder = Assets.WitchesAssets
local AnimationsFolder = Assets.Animations
local EffectsFolder = Assets.Effects
local SoundsFolder = Assets.Sounds
local RemoteEvents = ReplicatedStorage.RemoteEvents
local PlayAnimationEvent = RemoteEvents.AnimationClientEvent
local t = 1
function Code.Execute(Character,ContentTable)
local Player = Players:GetPlayerFromCharacter(Character)
local Target = ContentTable.Target
local TargetPlayer = ContentTable.TargetPlayer
local Damage
Damage = 2
local fire = ReplicatedStorage.FireParticle.Fire:Clone()
fire.Parent = Target.UpperTorso
local result = 15 * t
for t = 1,result,1 do
Target.Humanoid.Health -= Damage
wait(0.2)
end
fire:Destroy()
end
return Code