Как в этом скрипте заменить способ активации функции с прикосновения, на клик мышью???
local hat = game.ReplicatedStorage.CatWatermelon
local player = game:GetService("Players"
local RemoveAccessoriesOnTouch = false
local debounce = false
script.Parent.Touched:Connect(function(hit)
local d = hit.Parent:GetChildren()
if debounce == false then
if RemoveAccessoriesOnTouch == false and player then
if not hit.Parent:FindFirstChild("Hat" then
hat:Clone().Parent = hit.Parent
debounce = true
wait(5)
debounce = false
end
end
if debounce == false then
if RemoveAccessoriesOnTouch == true and player then
if not hit.Parent:FindFirstChild("Hat" then
for i=1, #d do
if (d.className == "Accessory" then
d:remove()
wait()
hat:Clone().Parent = hit.Parent
end
end
end
debounce = true
wait(5)
debounce = false
end
end
end
end)
local hat = game.ReplicatedStorage.CatWatermelon
local player = game:GetService("Players"
local RemoveAccessoriesOnTouch = false
local debounce = false
script.Parent.Touched:Connect(function(hit)
local d = hit.Parent:GetChildren()
if debounce == false then
if RemoveAccessoriesOnTouch == false and player then
if not hit.Parent:FindFirstChild("Hat" then
hat:Clone().Parent = hit.Parent
debounce = true
wait(5)
debounce = false
end
end
if debounce == false then
if RemoveAccessoriesOnTouch == true and player then
if not hit.Parent:FindFirstChild("Hat" then
for i=1, #d do
if (d.className == "Accessory" then
d:remove()
wait()
hat:Clone().Parent = hit.Parent
end
end
end
debounce = true
wait(5)
debounce = false
end
end
end
end)