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)
Umm you can use the Equipped
event.
Ex.
local tool = script.Parent.Parent local party = script.Parent tool.Equipped:connect(function() party.BrickColor = BrickColor.new("Really Red") end) tool.Activated:connect(function() print 'Hi' end)
^^ This is a simple and easy script but, the use of the Equipped
event makes it so that when equipped, the part changes color. Just use .Equipped:
for equipping and .Unequipped
for well, I guess you can figure that out.
If this doesn't help, then sorry.