#new to mouse.Target, not sure why this doesnt work:

7 messages · Page 1 of 1 (latest)

robust hamlet
#
mouse = game.Players.LocalPlayer:GetMouse()
RS = game:GetService("RunService")
rep = game.ReplicatedStorage
local target = mouse.Target
HL2 = rep.HL2:Clone()
HL = rep.HL:Clone()
RS.Heartbeat:Connect(function(step)
    print('tick')
    if target ~= nil then
    HL2.Parent = target
    HL2.Adornee = target
    HL2.LocalScript.Enabled = true
    HL.Parent = target
    HL.LocalScript.Enabled = true
    end
end)
#

HL & HL2 are mostly irrelevant, they're outlines

earnest stream
#

because target is only a variable u declare at the start of the script, so it would be keep the first target the mouse got, u would re-do the variable in the heartbeat

robust hamlet
#

oh

earnest stream
#

RS.Heartbeat:Connect(function(step)
print('tick')
target = mouse.Target
if target ~= nil then
HL2.Parent = target
HL2.Adornee = target
HL2.LocalScript.Enabled = true
HL.Parent = target
HL.LocalScript.Enabled = true
end
end)

robust hamlet
#

thanks

earnest stream
#

and heartbeat doesnt pass step