Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [[ VARIABLES ]] --
- local serverStorage = game.ServerStorage
- local serverScriptService = game.ServerScriptService
- local signal = serverStorage.Commands[script.Parent.Name][script.Name]
- local library = require(serverScriptService.FunctionLibrary)
- -- [[ FUNCTIONS ]] --
- -- On Signal
- function onSignal(player, input)
- local character = player.Character
- if #input > 0 then
- input = table.concat(input, " ")
- local endPunct = string.sub(input, #input, #input)
- local getEnities = character.Parent:GetChildren()
- for i = 1, #getEnities do
- if getEnities[i] ~= character then
- local iPlayer = game.Players:GetPlayerFromCharacter(getEnities[i])
- if iPlayer then
- local message = library.FilterMessage(player, iPlayer, input)
- if endPunct == "?" then
- library.ConsoleMessage(iPlayer, "General", "SAY", character.ALIAS.Value..' asks, "'..message..'"')
- elseif endPunct == "!" then
- library.ConsoleMessage(iPlayer, "General", "SAY", character.ALIAS.Value..' exclaims, "'..message..'"')
- elseif string.sub(message, #message - 2) == "..." then
- library.ConsoleMessage(iPlayer, "General", "SAY", character.ALIAS.Value..' trails off, "'..message..'"')
- else
- library.ConsoleMessage(iPlayer, "General", "SAY", character.ALIAS.Value..' says, "'..message..'"')
- end
- end
- else
- local message = library.FilterMessage(player, player, input)
- if endPunct == "?" then
- library.ConsoleMessage(player, "General", "DEFAULT", 'You ask, "'..message..'"')
- elseif endPunct == "!" then
- library.ConsoleMessage(player, "General", "DEFAULT", 'You exclaim, "'..message..'"')
- elseif string.sub(message, string.len(message) - 2) == "..." then
- library.ConsoleMessage(player, "General", "DEFAULT", 'You trail off, "'..message..'"')
- else
- library.ConsoleMessage(player, "General", "DEFAULT", 'You say, "'..message..'"')
- end
- end
- end
- else
- library.ConsoleMessage(player, "General", "ERROR", "You must include a message with the `say` command")
- end
- end
- -- [[ CALLS ]] --
- signal.Event:connect(onSignal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement