A little bit of context, I have it so that when the player joins the game, they get a tool in their backpack. And when they reset, it clones the tool and put's it in their backpack again. The issue is when I reset, the tool's code doesn't work.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Mouse = Player:GetMouse()

script.Parent.Activated:Connect(function()
	print("Hello!")
	if Mouse.Target ~= nil then
		local Tag = Mouse.Target:FindFirstChild("Fruit")
		if Tag ~= nil then
			if (Character.HumanoidRootPart.Position - Mouse.Target.Position).Magnitude <= 50 then
				game.ReplicatedStorage.Clicked:FireServer(Mouse.Target,script.Parent.Handle.Position)
			end
		end
	end
end)

The thing is, when I reset and click while equipped with the tool, it still prints("Hello!").

1 comment

0

Way more context, I added more prints, and it turned out the localscript for some reason kept printing the same Character.HumanoidRootPart.Position even though it was a clearly different position.