So i’m trying to add a revenge system and I have it so that when you get killed you get a death screen with the option to take revenge and kill them. However I can’t figure out how i would do this. But i did try this:
Here are the scripts:
serverscript:
-- Rest of the code
local Revenged = RevengeRemoteFunction:InvokeClient(enemyPlayer, plr)
if Revenged == true then
Humanoid.Health = 0
end
-- Rest of the code
local script:
revengeButton.MouseButton1Click:Connect(function()
buttonpressedRevenge = true
MPS:PromptProductPurchase(localplayer, RevengeProductId)
end)
for i = 50, 0, -1 do
--Here is the timer for how much seconds/10 you have to revenge
Revenge_RF.OnClientInvoke = function(plrToRevenge)
revengeDesc.Text = "Take revenge on: "..plrToRevenge.Name
if buttonpressedRevenge and localplayer:GetAttribute("BoughtRevenge") then
localplayer:SetAttribute("BoughtRevenge", false)
soundGuiGroup:WaitForChild("Revenge"):Play()
Frame.Visible = false
buttonpressedRevenge = false
return true
end
end
--Rest of the code for the timer
end
Sorry if the script is kinda bad lol.