You can write your topic however you want, but you need to answer these questions:
-
adding a cooldown to a command, with it returning only in seconds
-
always showing up as 15.660430030 or something with a decimal point and a ton of other numbers
-
can’t really find anything to solve this
handto UI with bindable events for a support system, integrated into basic admin, just can’t really understand like how to make it so it shows the cooldown in seconds, i’ve tried os.clock() and sort but just using tick() for at the moment
Author:
@TheFurryFish | (@RBLX_Fish)
-----------------------------
7/11/2015
--]]
local Config
local children = script:GetChildren()
script = Instance.new("ModuleScript")
for _, child in pairs(children) do
child.Parent = script
end
function StartModule(...)
local tuple = {...}
for i,v in pairs(tuple) do
Config = v
end
local rFunction = Instance.new('RemoteFunction',game.ReplicatedStorage)
rFunction.Name = ('HandTo_Sys')
local uEvent = Instance.new('BindableEvent',game.ReplicatedStorage)
uEvent.Name = ('UtilityFunction')
spawn(function()
game.ReplicatedStorage.ChildRemoved:connect(function(Item)
if Item.Name == ('UtilityFunction') then
if not game.ReplicatedStorage:FindFirstChild('UtilityFunction') then
uEvent = Instance.new('BindableEvent',game.ReplicatedStorage) -- leave non-local
uEvent.Name = ('UtilityFunction')
end
end
if Item.Name == ('HandTo_Sys') then
if not game.ReplicatedStorage:FindFirstChild('HandTo_Sys') then
rFunction = Instance.new('RemoteFunction',game.ReplicatedStorage) -- leave non-local
rFunction.Name = ('HandTo_Sys')
end
end
end)
end)
local Items = script:WaitForChild('Items')
require(Items:WaitForChild('GiveGui'))
local locScript = Items:WaitForChild('Main_Script')
locScript.Parent = game.StarterGui:WaitForChild('GiveGui')
local ConfigFolder = locScript:WaitForChild('Configuration')
local gID = ConfigFolder:WaitForChild('GroupID')
local rID = ConfigFolder:WaitForChild('RankID')
local kBind = ConfigFolder:WaitForChild('KeyBind')
gID.Value = Config['Group ID']
rID.Value = Config['Group Rank']
kBind.Value = Config['Key Bind']
local Cooldown = {}
function rFunction.OnServerInvoke(...)
local Data = {...}
local Player = Data[1]
local PlrChar = Player.Character
if Data[2] == 'support' then
if Cooldown[Player.UserId] == nil then
Cooldown[Player.UserId] = tick()
uEvent:Fire(Player,"Support")
uEvent:Fire(Player,"Logs",Player.Name..": Called for support!")
else
if tick() - Cooldown[Player.UserId] > 28 then
uEvent:Fire(Player,"Support")
uEvent:Fire(Player,"Logs",Player.Name..": Called for support!")
Cooldown[Player.UserId] = tick()
else
return uEvent:Fire(Player,"Notice","Error","Please wait before calling for assistance again!")
end
end
elseif Data[2] == "notify" then
uEvent:Fire(Player, "HintMsg","Player not found",Data[3].. " was not found. Make sure you're entering the username correctly.")
elseif Data[2] == "Hint" then
local Reply = uEvent:Fire(Player, 'HintMsg',Data[1],Data[2])
elseif Data[2] == "Commands" then
uEvent:Fire(Player, "Commands", nil)
elseif Data[2] == ('HandTo') then
if Data[3] ~= nil and game.Players:FindFirstChild(Data[3]) then
local Reciever = game.Players:WaitForChild(Data[3])
if PlrChar:FindFirstChild(Data[4]) then
local Item = PlrChar:WaitForChild(Data[4])
Item.Parent = Reciever.Backpack
------------------
uEvent:Fire(Player,"Logs",Player.Name..": Gave "..Item.Name.." to "..Reciever.Name)
------------------
uEvent:Fire(Player,'HintMsg',"Successfully gave item to "..Reciever.Name,'You gave '..Item.Name.. " to "..Reciever.Name)
------------------
uEvent:Fire(Reciever, 'HintMsg',"Utility System | "..Player.Name.." gave you an item",Player.Name.." gave you the item: '"..Item.Name.."'")
end
if Data[4] ~= nil and tostring(Data[3]) ~= nil then
return 'You gave '..'"'..tostring(Data[4])..'" to '..tostring(Data[3])..''
end
end
else
return "Error - Data[2] is not specified correctly."
end
end
end
return StartModule[quote="jackson, post:1, topic:2704172, full:true, username:MACBO0KS"]
You can write your topic however you want, but you need to answer these questions:
1. adding a cooldown to a command, with it returning only in seconds
2. always showing up as 15.660430030 or something with a decimal point and a ton of other numbers
3. can't really find anything to solve this
```--[[
Author:
@TheFurryFish | (@RBLX_Fish)
-----------------------------
7/11/2015
--]]
local Config
local children = script:GetChildren()
script = Instance.new("ModuleScript")
for _, child in pairs(children) do
child.Parent = script
end
function StartModule(...)
local tuple = {...}
for i,v in pairs(tuple) do
Config = v
end
local rFunction = Instance.new('RemoteFunction',game.ReplicatedStorage)
rFunction.Name = ('HandTo_Sys')
local uEvent = Instance.new('BindableEvent',game.ReplicatedStorage)
uEvent.Name = ('UtilityFunction')
spawn(function()
game.ReplicatedStorage.ChildRemoved:connect(function(Item)
if Item.Name == ('UtilityFunction') then
if not game.ReplicatedStorage:FindFirstChild('UtilityFunction') then
uEvent = Instance.new('BindableEvent',game.ReplicatedStorage) -- leave non-local
uEvent.Name = ('UtilityFunction')
end
end
if Item.Name == ('HandTo_Sys') then
if not game.ReplicatedStorage:FindFirstChild('HandTo_Sys') then
rFunction = Instance.new('RemoteFunction',game.ReplicatedStorage) -- leave non-local
rFunction.Name = ('HandTo_Sys')
end
end
end)
end)
local Items = script:WaitForChild('Items')
require(Items:WaitForChild('GiveGui'))
local locScript = Items:WaitForChild('Main_Script')
locScript.Parent = game.StarterGui:WaitForChild('GiveGui')
local ConfigFolder = locScript:WaitForChild('Configuration')
local gID = ConfigFolder:WaitForChild('GroupID')
local rID = ConfigFolder:WaitForChild('RankID')
local kBind = ConfigFolder:WaitForChild('KeyBind')
gID.Value = Config['Group ID']
rID.Value = Config['Group Rank']
kBind.Value = Config['Key Bind']
local Cooldown = {}
function rFunction.OnServerInvoke(...)
local Data = {...}
local Player = Data[1]
local PlrChar = Player.Character
if Data[2] == 'support' then
if Cooldown[Player.UserId] == nil then
Cooldown[Player.UserId] = tick()
uEvent:Fire(Player,"Support")
uEvent:Fire(Player,"Logs",Player.Name..": Called for support!")
else
if tick() - Cooldown[Player.UserId] > 28 then
uEvent:Fire(Player,"Support")
uEvent:Fire(Player,"Logs",Player.Name..": Called for support!")
Cooldown[Player.UserId] = tick()
else
return uEvent:Fire(Player,"Notice","Error","Please wait before calling for assistance again!")
end
end
elseif Data[2] == "notify" then
uEvent:Fire(Player, "HintMsg","Player not found",Data[3].. " was not found. Make sure you're entering the username correctly.")
elseif Data[2] == "Hint" then
local Reply = uEvent:Fire(Player, 'HintMsg',Data[1],Data[2])
elseif Data[2] == "Commands" then
uEvent:Fire(Player, "Commands", nil)
elseif Data[2] == ('HandTo') then
if Data[3] ~= nil and game.Players:FindFirstChild(Data[3]) then
local Reciever = game.Players:WaitForChild(Data[3])
if PlrChar:FindFirstChild(Data[4]) then
local Item = PlrChar:WaitForChild(Data[4])
Item.Parent = Reciever.Backpack
------------------
uEvent:Fire(Player,"Logs",Player.Name..": Gave "..Item.Name.." to "..Reciever.Name)
------------------
uEvent:Fire(Player,'HintMsg',"Successfully gave item to "..Reciever.Name,'You gave '..Item.Name.. " to "..Reciever.Name)
------------------
uEvent:Fire(Reciever, 'HintMsg',"Utility System | "..Player.Name.." gave you an item",Player.Name.." gave you the item: '"..Item.Name.."'")
end
if Data[4] ~= nil and tostring(Data[3]) ~= nil then
return 'You gave '..'"'..tostring(Data[4])..'" to '..tostring(Data[3])..''
end
end
else
return "Error - Data[2] is not specified correctly."
end
end
end
return StartModule’’’