Here is the code:
script.Parent.Activated:Connect(function()
print("Hello!")
print(Mouse)
print(Character)
print(Player)
print(Mouse.Target)
if Mouse.Target ~= nil then
print("2")
local Tag = Mouse.Target:FindFirstChild("Fruit")
if Tag ~= nil then
print("3")
print(Mouse.Target.Position)
print(Character.HumanoidRootPart.Position)
if (Character:WaitForChild("HumanoidRootPart").Position - Mouse.Target.Position).Magnitude <= 50 then
game.ReplicatedStorage.Clicked:FireServer(Mouse.Target,script.Parent.Handle.Position)
print("1")
end
end
end
end)
It works perfectly well when the player's first spawns. But when the player resets, it starts printing the same exact HumanoidRootPart.Position no matter what. Even if I moved my character, it keeps printing the same thing.
