i've been wondering though how to make one i can't think of one because i'm kind of new to scripting the die when you drink too much bloxy cola came to me when i played delicious consumables simulator
This is a server script and you'll need to put it into the tool. Btw this is an overcomplicated version and the lethalAmount variable is how many times the player has to drink before he dies. You can edit it to whatever value you would like it to be.
local drinkCounter local lethalAmount = 5 script.Parent.Equipped:Connect(function(player) if script.Parent.Parent:IsA("Model") then local character = workspace[script.Parent.Parent.Name] local playerCounter = Instance.new("IntValue", character) playerCounter.Name = script.Parent.Name drinkCounter = playerCounter else if script.Parent.Parent:IsA("Backpack") then local character = workspace[script.Parent.Parent.Parent.Name] local playerCounter = Instance.new("IntValue", character) playerCounter.Name = script.Parent.Name drinkCounter = playerCounter end end end) script.Parent.Activated:connect(function(player) drinkCounter.Value = drinkCounter.Value + 1 if drinkCounter.Value == lethalAmount then if script.Parent.Parent:IsA("Model") then local character = workspace[script.Parent.Parent.Name] character.Humanoid.Health = 0 drinkCounter.Value = 0 else if script.Parent.Parent:IsA("Backpack") then local character = workspace[script.Parent.Parent.Parent.Name] character.Humanoid.Health = 0 drinkCounter.Value = 0 end end end end)
Closed as Not Constructive by lazycoolboy500 and imKirda
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?