If the player is holding the tool (in water) it should make the player float up to the surface of the water and when its unequipped the player stays in a hover like position in the water.
But when i equip the tool it doesnt do anything.
Script found in the tool as a script not local.
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
Players.PlayerAdded:Connect(function(Player)
local char = Player.Character or Player.CharacterAdded:Wait()
local c = char:GetChildren()
local bouy = script.Parent
bouy.Equipped:Connect(function()
local Density = 0.01
for i = 1, #c do
if c[i]:IsA("BasePart") then
c[i].CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
elseif c[i].ClassName == "Accessory" then
c[i].Handle.CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
end
end
end)
bouy.Unequipped:Connect(function()
local Density = 0.775
for i = 1, #c do
if c[i]:IsA("BasePart") then
c[i].CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
elseif c[i].ClassName == "Accessory" then
c[i].Handle.CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
end
end
end)
end)