#ZonesPlus is breaking lerps?

1 messages · Page 1 of 1 (latest)

vapid cypress
#

I want all this code to be looped inside of this zone i made using zonesplus, but even though I have a renderstepped loop around the whole thing, it seems to only run once. Even if I put a loop inside the "zone.localPlayerEntered" the "zoned" print will show that it is running through the whole thing, but the lerp and the lookAt isnt actively working.

#

This script is managing mutliple models so just ignore those :-)

#

I cant send the script wth

mossy yew
#

nvm I dont need to copy the code

vapid cypress
#

oki, yeah i tried pasting it but it said I didnt share a server with the recipeient or sum so idk what that was abt

mossy yew
#

this code works as it should you just have a logic issue here

vapid cypress
#

what is it? The code is outputting what was in that video

mossy yew
#
RunService.RenderStepped:Connect(function()
    
    game.Players.PlayerAdded:Connect(function(player)
        print(player) -- will only print once
    end)
    
end)
#

for you you are waiting for the player to enter and then you print it once also

#

if you want to create a loop after he entered you would have todo this:

#
game.Players.PlayerAdded:Connect(function(player)

    RunService.RenderStepped:Connect(function()
        print(player) -- will print infinite times
    end)

end)
vapid cypress
#

would i have to stop the original renderstepped loop that goes around everything?

mossy yew
#

no but that loop is kinda not necessary

#

or idk if it is for you but I dont think it is

#

it just takes performance away

vapid cypress
#

well, it runs the other models that follow your character model. Would it be more beneficial to set up zones near each model and only have loops run when they are near?

mossy yew
vapid cypress
#

oki yeah

mossy yew
#

you can store loops in variables and :Disconnect them

#
--Example:

local newLoop = RunService.RenderStepped:Connect(function()
    print("wow")
end)

newLoop:Disconnect()
vapid cypress
#

so, would I put "loopname:Disconnect()" in each zones "localPlayerExited"?

mossy yew
#

I would set it up like this:

player.ZoneEntered:Connect(function()
    local newLoop = RunService.RenderStepped:Connect(function()
        print("wow")
    end)
    
    player.ZoneLeft:Connect(function()
        newLoop:Disconnect()
    end)
end)
vapid cypress
#

is ZoneEntered and ZoneLeft how you use zonesplus?

mossy yew
#

no you gotta adjust that for your code

vapid cypress
#

ah ok

mossy yew
#
#

idk if your using v3.2.0 but this is the documentation

vapid cypress
# mossy yew no you gotta adjust that for your code

so it works, connect and disconnecting the zones. As well as looping them. But the problem is the lerp that the head of the cupcake uses, and the PivotTo that the eyes use are both still frozen like in my video

mossy yew
#

ive never used lerp before tbf

vapid cypress
#

new script that still isnt working :/

mossy yew
#

I rlly cant help you with that I dont work with CFrames or Lerp too much