Local script
local proximityPrompt = script.Parent
local RS = game:GetService("ReplicatedStorage")
local SweepEvent = RS.Events:WaitForChild("Sweep")
proximityPrompt.PromptButtonHoldBegan:Connect(function(player)
SweepEvent:FireServer("Stop")
print("Began")
end)
SSS
local RS = game:GetService("ReplicatedStorage")
local SweepEvent = RS.Events:WaitForChild("Sweep")
SweepEvent.OnServerEvent:Connect(function(Player, Action)
if Action == "Stop" then
local character = Player:FindFirstChild("Character")
local humanoid = character:FindFirstChild("Humanoid")
print("Fired")
if character and humanoid then
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
humanoid.UseJumpPower = true
humanoid.AutoJumpEnabled = false
end
end
end)
When you start holding the proximity prompt a remote event fire. It not working no errors