I am currently trying to create a timed event for example if you don’t interact with this within 10 seconds then this happens or if you interact with it within the 10 seconds then another thing happens
both server sided scripts
local rep = game:GetService("ReplicatedStorage")
local StaggerEvent = rep.FInisherEvents:WaitForChild("Stagger")
local serverstorage = game:GetService("ServerStorage")
local Assests = serverstorage["Finishing move stuff"]
local SeeEvent = rep.FInisherEvents:WaitForChild("No see")
local starting = rep.FInisherEvents:WaitForChild("StartFinish")
local kill = rep.FInisherEvents:WaitForChild("Kill")
local canfinish = true
StaggerEvent.OnServerEvent:Connect(function(player)
if canfinish == true then
canfinish = false
print(player)
local Prompt = Assests:FindFirstChild("Finisher")
Prompt.Enabled = false
local prompt2 = Prompt:Clone()
prompt2.Enabled = false
prompt2.Parent = player.Character:FindFirstChild("Torso")
prompt2.Enabled = true
local root = player.Character:FindFirstChild("HumanoidRootPart")
root.Anchored = true
SeeEvent:FireClient(player)
elseif wait(10) then
canfinish = false
end
end)
kill.OnServerEvent:Connect(function(player)
print("death")
local humanoid = player.Character:FindFirstChild("Humanoid")
humanoid.Health = 0
end)
local prompt = script.Parent
local playerr = prompt.Parent
local starting = game.ReplicatedStorage.FInisherEvents:FindFirstChild("StartFinish")
local serverstorage = game:GetService("ServerStorage")
local Assests = serverstorage["Finishing move stuff"]
local Begin = game:GetService("ReplicatedStorage").FInisherEvents:WaitForChild("Begin")
local function Finish ()
local Prompt = Assests:FindFirstChild("Finisher")
Prompt.Enabled = false
local char = prompt.Parent.Parent
char.HumanoidRootPart.Anchored = true
local man = game.Players:GetPlayerFromCharacter(char)
Begin:FireClient(man)
end
prompt.Triggered:Connect(function(player)
wait(0.7)
print(player)
local prompt = playerr:FindFirstChild("Finisher")
prompt.Enabled = false
Begin:FireClient(player)
Finish()
end)
I don’t think I’ve written it correctly I have multiple event shooting to multiple scripts.