✓ Accepted answer
The reason for this is line 6.
if mouse.Target.Parent == "Test" then
The Mouse.Target property holds a reference, a reference to the BasePart the mouse is hovering over. In order to fix this, you should check the Name of the Target.
local UserInputService = game:GetService("UserInputService")
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
UserInputService.InputBegan:Connect(function(input, gpe)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if not Mouse.Target then return end
if Mouse.Target.Parent.Name == "Test" then
Mouse.Target.Parent.Humanoid.Health = 25
end
end
end)
And finally, remember to indent your code properly. Your end on line 9 is not inside of the event, it is shifted to the left. Even if it's one line, it is important to have indented code, for the sake of readability.
####Hope this helped!