Hello, I need script when player moves then hose will move too but
GetPropertyChangedSignal is not working
Script
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local RegistredHydrants = game.ReplicatedStorage.RegistredHydrants
local CheckIfRope = game.ReplicatedStorage.HydrantRemotes.CheckIfRope
local GetPlayerRope = game.ReplicatedStorage.HydrantRemotes.GetPlayerRope
local CreateRope = game.ReplicatedStorage.HydrantRemotes.CreateRope
local DeleteRope = game.ReplicatedStorage.HydrantRemotes.DeleteRope
local ActualTool
wait(2)
local Player = game.Players.LocalPlayer
local ActualHyd
local Character = Player.Character
if Player.Backpack:FindFirstChild("Fire Hose") then
ActualTool = Player.Backpack:FindFirstChild("Fire Hose")
elseif Character:FindFirstChild("Fire Hose") then
ActualTool = Character:FindFirstChild("Fire Hose")
end
-- THIS PART
Character.HumanoidRootPart:GetPropertyChangedSignal("Position"):Connect(function()
local Bool = CheckIfRope:InvokeServer()
if Bool == true and ActualTool.Parent == Character then
DeleteRope:FireServer()
CreateRope:FireServer(ActualHyd.Value.Join,ActualTool.Handle.Join)
end
end)
-- END OF PART
UserInputService.InputBegan:Connect(function(key) --Create new rope
for _,hyd in pairs(RegistredHydrants:GetChildren()) do
if (hyd.Value.Position - Character.HumanoidRootPart.Position).Magnitude <= 3 and key.KeyCode == Enum.KeyCode.E and ActualTool.Parent == Character then
local Bool = CheckIfRope:InvokeServer()
if Bool == false then
CreateRope:FireServer(hyd.Value.Join,ActualTool.Handle.Join)
ActualHyd = hyd
end
end
end
end)
Thank for any tips.