Need help with this script

so you know when in some story games someone gets poisoned and you need to find the object so he does not die I am having trouble with that script I tried everything please someone help

1 Like

Could you provide more information of what you want the script to do?

1 Like

Yeah so I want like everyone to eat something then they get poison then they have a countdown to fine a object so he doesn’t die if they don’t find the item they he dies if they do he doesn’t die

1 Like

I meant one person to get poison

1 Like

Can you show us what you’ve made so far?

2 Likes

Is it for a group to find or that individual who has been poisoned?

It’s blanked because I tried fixing it before then (idk who) deleted it I have no way to recovered it the I stumbled here and I like to refresh my script and I think my brother deleted tbh

No it’s a group trying to find an object so the victim doesn’t die

I regret to say, I have nothing. I am so sorry.

Can you not gain the script from old versions of the game? You can check the version history?

Yeah I did already I have been looking for ages

I have an idea, you can create a table for all the players in a game, make a random player get poisoned, and check to see if a player has a certain tool. Here’s an example:

local players = {game.Players:GetChildren()}
local lP = game.Players.LocalPlayer
-- function line goes here
local poisonedPlayer = math.random([1, #players])
if poisonedPlayer then
    for countdown = -- however many integers you want go here
    do
        wait(countdown)
        if lP.Characther.Backpack:FindFirstChild([NameOfHealTool]) then
            poisonedPlayer.Health = 100 -- this line will not work if you don't specify what happens to the poisonedPlayer
            end
        end
    end
end)
1 Like

Wait this might be the solution

Remember though, that is only an example. You must specify other arguments in your script

Was that the solution? Or do you have more questions? (Sorry if I didn’t explain myself well)

Oh yeah it’s is let me do that real quick and thank you but do you know any sandwich model or any food model that I can use so I can let them eat for a second before that thing happens

Also I will ask for more questions if I need it :grin:

I found this

can you help me with the eating stuff or does it come with it