简体   繁体   中英

Script stops after a few seconds

I have this exploit for Murder Mystery 2 . It is a tpcoins and esp exploit. When I enable the tpcoins it will turn off after a few seconds. Is there any way of making it so it stays on?

Here's the code:

function enableTpCoin()
if nameMap ~= "" and wp[nameMap] ~= nil then
    if lplr.PlayerGui.MainGUI.Game.CashBag:FindFirstChild("Elite") then
        tpCoin(10)
    elseif lplr.PlayerGui.MainGUI.Game.CashBag:FindFirstChild("Coins") then
        tpCoin(15)
    end
end

Trigger to start the script is q .

Short answer, you can't. Since this is script related I'll answer your question. So each round, the player can only earn 10 coins, and 15 if they have purchased the "Elite" gamepass.

This meaning that the game physically doesn't allow you to add anymore per round. You'll have to execute the code at the launch of every round.

The game has FE, so it's most likely that the original developer of the game has specified the remote events to only accept 10 or 15 coins depending on the boolean value whether the user is "Elite" or not.

Even if Universal Link says the truth, here's the solution.

Create a new function. In that function, do a while loop with a interval (use wait(.1)), and in that while loop, call enableTpCoin().

Now, call spawn() and pass the function you created as an argument.

The code should look like this:

function _loop()
while wait(.1) do
enableTpCoin()
end
end

spawn(_loop)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM