I have a tool to make you levitate upwards in a localscript in a filtering not enabled game, but you don't need to equip the tool to levitate when you click. How do I make it so that you do?
This is the script.
local Character = game.Players.LocalPlayer.character
local TorPos = Character.HumanoidRootPart.Position
local Player = game.Players.LocalPlayer
local HumRoot = Character.HumanoidRootPart
local Mouse = Player:GetMouse()
local MystSkill = script.Parent.Mysticism.Value
local LevHeight = Vector3.new(0,.5*MystSkill,0)
script.Parent.Equipped:connect()
local Levitating = false
function levitate()
if Levitating == false then
Levitating = true
local BodyPos = Instance.new("BodyPosition")
BodyPos.Parent = Character.HumanoidRootPart
while Levitating == true do
BodyPos.Position = HumRoot.Position + LevHeight
wait(.000001)
end
BodyPos:Destroy()
end
end
function SetLevFalse()
Levitating = false
end
function PrintPos()
print(HumRoot.Position)
print("MystSkill", .5%MystSkill)
end
Mouse.Button1Down:connect(levitate)
Mouse.Button1Up:connect(SetLevFalse)
Mouse.Button2Down:connect(PrintPos)

1 comment
Tool.Activated would do what you want. Fires the signal when MB1 is clicked, only when the tool is equipped.