#Need help with fixing a bug in my rope script

1 messages · Page 1 of 1 (latest)

timid flame
#

I've been trying to fix a small bug/problem in my rope scripts for daysss now and still haven't been able to fix it. In case anyone would want to help I would really appreciate it. The rope itself works fine, but when players fall in the air the ropes start bugging, the players start slingshotting, the players accelerate, the rope breaks and then they die even tho they shouldn't die. I wish that the rope didn't accelerate and just slingshot in the air, I'd want it to work in a way where both players somehow just fall to the ground without the rope stretching out in ridiculous ways.

#

and my RopeServerHandler

-- RopeServerHandler | ServerScriptService
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TriggerRagdoll = ReplicatedStorage:WaitForChild("TriggerRagdoll")

local ropeConnections = {}

local function cleanupBoth(player)
local other = ropeConnections[player]
ropeConnections[player] = nil
if other then
ropeConnections[other] = nil
end
end

TriggerRagdoll.OnServerEvent:Connect(function(player, action, otherChar)
if action == "connect" then
local otherPlayer = Players:GetPlayerFromCharacter(otherChar)
if otherPlayer then
ropeConnections[player] = otherPlayer
ropeConnections[otherPlayer] = player
end

elseif action == "disconnect" then
    cleanupBoth(player)

elseif action == "kill" then
    local myChar = player.Character
    if myChar then
        local h = myChar:FindFirstChildOfClass("Humanoid")
        if h then h.Health = 0 end
    end
    if otherChar and otherChar:IsA("Model") then
        local h = otherChar:FindFirstChildOfClass("Humanoid")
        if h then h.Health = 0 end
    end
    cleanupBoth(player)
end

end)

_G.IsRoped = function(player)
return ropeConnections[player] ~= nil
end

Players.PlayerRemoving:Connect(function(player)
local other = ropeConnections[player]
if other and other.Character then
local h = other.Character:FindFirstChildOfClass("Humanoid")
if h then h.Health = 0 end
end
cleanupBoth(player)
end)

Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
cleanupBoth(player)
end)
end)

#

I even tried to use Claude AI to fix it but nothing seems to work...

novel badger
#

u used

#

claude wrong

#

then

timid flame
#

How so? I've tried every way, but I just feel like this is out of AI's reach.

novel badger
#

lets see

#

I asked to fix it my own way

#

lets see if it works

timid flame
#

Tell me how it goes

steel whaleBOT
#

studio** You are now Level 5! **studio

novel badger
#

writes it

timid flame
#

What is ''your way'' if you don't mind me asking

novel badger
novel badger
#

so test first xD

#

server script dont need changes

timid flame
#

Okay I tried pasting it into my RopeLocalScript and now the rope just loses all elasticity and just causes the player to die/the rope to break if you walk too far away from the other player. I can send a video clip if u want.

#

but yeah Ive had this same problem for a long time now. Cause normally the elasticity is fine, it is just the mid air slingshotting thing that is the problem.

novel badger
#

yeah claude too stupid to fix ropes

#

mhmmhmhmhmhmhmh

#

server one

#

local one

#

if this not work, then u need a real pro scripter help u xD

timid flame
#

Hmmm I mean this one worked really well due to it not bugging out mid air. The only problems I had was the rope probably bugging due to my ragdoll script, which shouldn't be hard to fix. But also the fact that one of the players had some lag, which I also can fix. Thanks dude.

#

Can I ask what your method was?

novel badger
#

I told it never guess code, I dont want guessed code, do a research to be able to help me properly

#

AI tends totry to guess code thats why errors appear

timid flame
#

oh got ya