local Player = Args[1]
for i,v in pairs(game.Players:GetChildren()) do
if returnPermissions(v) >= 1 then
remoteEvent:FireClient(v,"Notif","Help Requested", "Click to teleport", "")
end
end
end
Alright, I will play around tomorrow. I have the button, just can’t get the actual teleportation part working. If you could provide me with a basic script, that would be helpful.
local Plugin = function(...)
local Data = {...}
-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
-- Keep track of the last admin who clicked the notification
local lastAdminClicked = nil
-- Plugin Configuration --
local pluginName = 'help'
local pluginPrefix = actionPrefix
local pluginLevel = 1
local pluginDescription = "Call for an admin's support."
-- Plugin Function --
local function pluginFunction(Args)
local Player = Args[1]
-- Check if an admin has already clicked the notification
if lastAdminClicked then
return "An admin is already on their way to assist you."
end
-- Store the admin who clicked the notification
lastAdminClicked = Player
-- Notify all admins except the one who clicked
for _, admin in ipairs(returnPlayers()) do
if admin ~= Player and returnPermissions(admin) >= 1 then
remoteEvent:FireClient(admin, "Notif", "Help Requested", "Click to teleport", "")
end
end
return "Admins have been notified about your request."
end
-- Register the plugin command
Commands[pluginName] = pluginFunction
-- Handle admin teleportation
remoteFunction.OnServerInvoke = function(Player, Data)
if Data == "TeleportAdmin" and lastAdminClicked == Player then
-- Implement teleportation logic here
-- Example: game.Workspace.AdminSpawn.CFrame = Player.Character.HumanoidRootPart.CFrame
-- Clear the last admin who clicked
lastAdminClicked = nil
return true -- Indicate successful teleportation
end
end
-- Return the plugin details
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginDescription}
end
return Plugin
local Plugin = function(...)
local Data = {...}
-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8]
-- Plugin Configuration --
local pluginName = 'help'
local pluginPrefix = actionPrefix
local pluginLevel = 0
local pluginUsage = ""
local pluginDescription = "Call for an admin's support."
-- Example Plugin Function --
local function pluginFunction(Args)
local Player = Args[1]
for _, Admin in ipairs(game.Players:GetPlayers()) do
if returnPermissions(Admin) >= 1 then
-- Send notification to admins
remoteEvent:FireClient(Admin, "Notif", "Help Requested", "Click to teleport", Player.Name)
-- Teleport admin to the player requesting help
Admin.Character:MoveTo(Player.Character.HumanoidRootPart.Position)
end
end
end
-- Return Everything to the MainModule --
local descToReturn
if pluginUsage ~= "" then
descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
else
descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
end
return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginUsage, pluginDescription}
end
return Plugin