So Make A Local Script Then Place The Local Script In Starter Pack then Copy This :
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local damage = 10
local run = game:GetService("RunService")
local timebeforeotherdamage = 0.5
repeat
wait()
until
player.Character
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
run.RenderStepped:Connect(function()
if mouse.Target == game.Workspace.Part then
humanoid:TakeDamage(1)
wait(timebeforeotherdamage)
end
end)
If This Worked Then Please Accept This As an Answer That Would Help Me,
Hope This Helps! If You Want An Explanation then feel free to respond to me!
15 comments
Whats The Models Name?
We haven't got to that yet. Just pretend it's a part in a model called "TakeDamage"
Did It Work?
Let me see
Yes it did but it needs to be the player looking at it not having there mouse on it right?
Hmm.. Well Then I Dont Think Theres Any Simple Way Of Doing ,Not That I Know Of Sorry :(
You can make a RayCast from the player to the part to see if they are looking at the part.
How'd I do that Uzixt?
But isnt Ray Casting Like Similar to The Mouse
Mouse.Hit
Maybe You Could Do RayCasting But the Catch Is That There Is An Invisible Object Which Is Following The Ray Which When Touching Slender Damages.. Im Not Sure If This One Works But Im Going To Try
Using Unit Should Limit How Far The Ray Can Go Depending On How Much You Time Unit.
Well I Think Your Question is Really Good, And I Dont Know Any Way To Execute That.
Could you not overuse title-casing, it makes it difficult to read your comments.
Well I am sorry, I can't help it.