local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RevengeEvent = ReplicatedStorage:WaitForChild("RevengeEvent")
RevengeEvent.OnServerEvent:Connect(function(player)
-- Add your logic here to handle the revenge event
print(player.Name .. " triggered the revenge event!")
-- Example: Reduce player's health
local frametext = player.PlayerGui.DialogGui.DialogFrame.text
if frametext then
frametext.Text = "in return..."
wait(2)
frametext.Text = "run down the basement"
wait(2)
frametext.Text = "3"
wait(1)
frametext.Text = "2"
wait(1)
frametext.Text = "1"
wait(1)
-- here is where i want the clone to happen
end
end)
and idk how to make it so that after the last wait, a model called “killer” clones from the server storage and its position where it clones will be the Cframe of a part called “killerspawn”
local ModelToClone = game:GetService("ServerStorage").NameOfYourModel
local KillerPart = workspace.killerspawn
--// Clone model
local ClonedModel = ModelToClone:Clone()
ClonedModel:PivotTo(KillerPart.CFrame)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RevengeEvent = ReplicatedStorage:WaitForChild("RevengeEvent")
local ModelToClone = game:GetService("ServerStorage").NameOfYourModel
local KillerPart = workspace.killerspawn
RevengeEvent.OnServerEvent:Connect(function(player)
-- Add your logic here to handle the revenge event
print(player.Name .. " triggered the revenge event!")
-- Example: Reduce player's health
local frametext = player.PlayerGui.DialogGui.DialogFrame.text
if frametext then
frametext.Text = "in return..."
wait(2)
frametext.Text = "run down the basement"
wait(2)
frametext.Text = "3"
wait(1)
frametext.Text = "2"
wait(1)
frametext.Text = "1"
wait(1)
-- here is where i want the clone to happen
local ClonedModel = ModelToClone:Clone()
ClonedModel:PivotTo(KillerPart.CFrame)
end
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RevengeEvent = ReplicatedStorage:WaitForChild("RevengeEvent")
local ModelToClone = game:GetService("ServerStorage").killer
local KillerPart = workspace.killerspawn
RevengeEvent.OnServerEvent:Connect(function(player)
-- Add your logic here to handle the revenge event
print(player.Name .. " triggered the revenge event!")
-- Example: Reduce player's health
local frametext = player.PlayerGui.DialogGui.DialogFrame.text
if frametext then
frametext.Text = "in return..."
wait(2)
frametext.Text = "run down the basement"
wait(2)
frametext.Text = "3"
wait(1)
frametext.Text = "2"
wait(1)
frametext.Text = "1"
wait(1)
-- here is where i want the clone to happen
local ClonedModel = ModelToClone:Clone()
ClonedModel:PivotTo(KillerPart.CFrame)
end
end)
Disable it on a local script. For maximum efficiency change the remote event you’re using to a remote function and return true to signal success
Client script ig
local gui = -- Gui here
local success = RevengeEvent:InvokeServer()
if success then gui.Enabled = false end
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RevengeEvent = ReplicatedStorage:WaitForChild("RevengeEvent")
RevengeEvent.OnServerInvoke = function(player)
-- Add your logic here to handle the revenge event
print(player.Name .. " triggered the revenge event!")
-- Example: Reduce player's health
local frametext = player.PlayerGui.DialogGui.DialogFrame.text
if frametext then
frametext.Text = "in return..."
wait(2)
frametext.Text = "run down the basement"
wait(2)
frametext.Text = "3"
wait(1)
frametext.Text = "2"
wait(1)
frametext.Text = "1"
wait(1)
local killer = game.ServerStorage.Killer:Clone()
killer.Parent = workspace
killer:PivotTo(workspace.killerspawn.CFrame)
return true
end