Is there anything wrong about it?
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,damage) local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = script.Parent local play = player.Name print(play) mouse = player:GetMouse() if mouse.Target.Configuration.Axe.Value == true then local thing = mouse.Target thing.Configuration.HP.Value = thing.Configuration.HP.Value - damage game.ReplicatedStorage.RE.MM:FireServer(thing.Configuration.NAM,thing.Configuration.HP,thing.Configuration.MHP) elseif mouse.Target == nil then end end)
The thing you did wrong is trying to get the players mouse through a server script. Its only accessible in a local script.
You would need to go back to your server script where you fired the event, and add the mouses target through the :FireServer() event.
Example:
Local:
local mouse = player:GetMouse() local damage = 10 local target = mouse.Target event:FireServer(damage, target)
Server:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player,damage, target) local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = script.Parent local play = player.Name print(play) if target.Configuration.Axe.Value == true then local thing = target thing.Configuration.HP.Value = thing.Configuration.HP.Value - damage game.ReplicatedStorage.RE.MM:FireServer(thing.Configuration.NAM,thing.Configuration.HP,thing.Configuration.MHP) elseif target == nil then end end)
(Im not 100% sure this will work, so if u have any problems please comment.)