-- Variables
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local code = require(game.ReplicatedStorage.DataSource.EnumType).clientRemoteEvent.DamageMonster
local unit = (function()
for i,v in pairs(workspace.PlaceHero:GetChildren()) do
if v.Name:find("Valdor") then
return v.Name
end
end
end)()
mouse.KeyDown:connect(function(key)
if key == "q" then
if mouse.Target then
for i,v in pairs(workspace.Monsters:GetChildren()) do
game.ReplicatedStorage.RemoteEvent["RemoteEvent_Notice"]:FireServer(code, {unit,{v}})
end
wait(1)
end
end
end)
What if I want to change the damage to coins? Why can't I get coins even though the function works without errors How to change the code correctly to receive coins?
https://media.discordapp.net/attachments/928790139122094130/928790292415537223/07-01-2022_021900.jpg
