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)
#new to mouse.Target, not sure why this doesnt work:
7 messages · Page 1 of 1 (latest)
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
oh
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)
thanks
and heartbeat doesnt pass step