Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Inanimate Script broke, any solutions?

Asked by
Tycy8 15
9 years ago

Hello, so I have a gourney which has a seat and within that seat contains a 'Standing' script which consists of subscripts 'Anim' and 'Inanimiate.' I seem to have an issue with the 'Inanimate' script because it's main purpose is to physically make a player stand up in a seat to make it look like they are laying down on the gourney. This did work before but now there seems to be a problem where every person's limbs in the game won't move even after resetting. I have traced the problem to the 'Inanimate' script but can't figure out what the problem is.

To know what I'm talking about just visit my hospital: http://www.roblox.com/games/166356838/RGH-Robloxian-Permanente-Medical-Center

Gourney I'm talking about: http://www.roblox.com/InanimateLog-item?id=261072916

print("INANIMATOR LOADED")

function onPlayerRespawn(property, player)
    -- need to connect to new humanoid

    if property == "Character" and player.Character ~= nil then
        local animate = player.Character:findFirstChild("Animate")
        if animate ~= nil then
            animate.Parent = nil
        end
    end
end

function onPlayerEntered(newPlayer)

    while true do
        if newPlayer.Character ~= nil then break end
        wait(0)
    end
    local animate = newPlayer.Character:findFirstChild("Animate")
    if animate ~= nil then
        animate.Parent = nil

    end

    -- start to listen for new humanoid
    newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )

end

game.Players.ChildAdded:connect(onPlayerEntered)
0
Use the 'PlayerAdded' event rather than 'ChildAdded'. unmiss 337 — 9y
0
@Jackctaylor Tried no difference. Tycy8 15 — 9y

Answer this question