local tool = script.Parent
local updateMagic = game.ReplicatedStorage:WaitForChild("RemoteEvents").UpdateMagic
local backpack = tool.Parent
local player = backpack.Parent
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local moving = false
local meditating = false
local equipped = false
local activated = false
local meditationBar = player.PlayerGui.MeditationBar
local frame = meditationBar.Frame
local progress = frame.Progress
function equip()
character = player.Character or player.CharacterAdded:Wait()
humanoid = character:WaitForChild("Humanoid")
equipped = true
end
function unequip()
equipped = false
meditating = false
frame.Visible = false
tool.med.Disabled = true
end
function onActivation()
if moving == false and equipped and meditating == false then
print(moving)
print(equipped)
print(meditating)
frame.Visible = true
meditating = true
tool.med.Disabled = false
end
end
function moveDetect(speed)
if equipped then
if speed > 5 then
moving = true
meditating = false
frame.Visible = false
tool.med.Disabled = true
print("moving")
else
moving = false
print("stoppedmoving")
end
end
end
tool.Equipped:Connect(equip)
tool.Unequipped:Connect(unequip)
humanoid.Running:Connect(moveDetect)
tool.Activated:Connect(onActivation)
I noticed mainly the move detect area stops working and the frame.Visible = true in activation
