How come my money give command wont work. What's happening?
Asked by
4 years ago Edited 4 years ago
--//Description\--
I have 2 scripts. One called AdminHandler and another called Controller. I know Controller sends the data I need to send but the admin handler won't run the command. Whats happen?
--//AdminHander\--
003 | [ "vincentthecat1" ] = 1 ; |
005 | [ "EatSomeSand123" ] = 3 ; |
016 | [ "AntiHaxRemover" ] = 1 ; |
024 | game.ReplicatedStorage.AdminEvents.AddMoneyEvent.OnServerEvent:Connect( function (player, victim, amount) |
025 | if admins [ player.Name or player.UserId ] then |
027 | local foundGive = game.Players:FindFirstChild(victim) |
028 | local give = script.AddAmount.Value |
032 | foundGive.leaderstats.Cash.Value = foundGive.leaderstats.Cash.Value +give |
038 | game.Players.PlayerAdded:Connect( function (player) |
039 | if admins [ player.Name or player.UserId ] then |
042 | TagText = "?????????" , |
043 | TagColor = Color 3. fromRGB( 107 , 50 , 124 ) |
046 | local ChatService = require(game:GetService( "ServerScriptService" ):WaitForChild( "ChatServiceRunner" ).ChatService) |
048 | while speaker = = nil do |
049 | speaker = ChatService:GetSpeaker(player.Name) |
050 | if speaker ~ = nil then break end |
053 | speaker:SetExtraData( "Tags" ,tags) |
054 | speaker:SetExtraData( "ChatColor" ,Color 3. fromRGB( 161 , 94 , 13 )) |
059 | game.Players.PlayerAdded:Connect( function (player) |
060 | if manualBans [ player.Name or player.UserId ] then |
061 | player:Kick( "You are automaticly banned as you have a history of exploting." ) |
065 | game.Players.PlayerAdded:Connect( function (player) |
066 | if admins [ player.Name or player.UserId ] then |
067 | local clone = script [ "AdminPanel" ] :Clone() |
068 | clone.Parent = player.PlayerGui |
073 | game.ReplicatedStorage.AdminEvents.ServerBanEvent.OnServerEvent:Connect( function (player 1 , victim 1 , reason 1 ) |
074 | if admins [ player 1. Name or player 1. UserId ] then |
076 | local found = game.Players:FindFirstChild(victim 1 ) |
077 | local foundClone = script.victimName:Clone() |
080 | foundClone.Parent = game.Workspace.ServerBans |
081 | foundClone.Name = found.Name |
082 | foundClone.Value = found.UserId |
083 | found:Kick( "You have been banned by " .. player 1. Name.. " for " ..reason 1 .. "." ) |
084 | game.ReplicatedStorage.AdminEvents.PlayerServerBannedEvent:FireAllClients(victim 1 ) |
086 | game.Players.PlayerAdded:Connect( function (player) |
087 | if game.Workspace.ServerBans:FindFirstChild(player.Name) then |
088 | player:Kick( "You are banned from this server." ) |
089 | game.ReplicatedStorage.AdminEvents.PlayerServerBannedEvent:FireAllClients(victim 1 ) |
096 | game.ReplicatedStorage.AdminEvents.ServerKickEvent.OnServerEvent:Connect( function (player 2 , victim 2 , reason 2 ) |
097 | if admins [ player 2. Name or player 2. UserId ] then |
099 | local foundKick = game.Players:FindFirstChild(victim 2 ) |
102 | foundKick:Kick( "You have been kicked by " .. player 2. Name.. " for " ..reason 2 .. "." ) |
103 | game.ReplicatedStorage.AdminEvents.PlayerKickedEvent:FireAllClients(victim 2 ) |
109 | game.ReplicatedStorage.AdminEvents.GlobalBanEvent.OnServerEvent:Connect( function (player 3 , victim 3 , reason 3 ) |
110 | if admins [ player 3. Name or player 3. UserId ] then |
112 | local foundGlobal = game.Players:FindFirstChild(victim 3 ) |
115 | foundGlobal.GlobalBan.Value = true |
116 | foundGlobal:Kick( "You have been banned by " .. player 3. Name .. " You have been banned from the game, due to our moderators finding you unfit to play." ) |
117 | game.ReplicatedStorage.AdminEvents.PlayerGlobalBannedEvent:FireAllClients(victim 3 ) |
119 | game.Players.PlayerAdded:Connect( function (player) |
120 | if player.GlobalBans.Value = = true then |
121 | player:Kick( "You have been banned from the game, due to our moderators finding you unfit to play." ) |
122 | game.ReplicatedStorage.AdminEvents.PlayerGlobalBannedEvent:FireAllClients(victim 3 ) |
127 | local minimumAge = 25 |
128 | game.Players.PlayerAdded:Connect( function (player) |
129 | if (player.AccountAge < minimumAge) then |
130 | player:Kick( "Your account must be at least " .. tostring (minimumAge).. " days old to play this game!" ) |
137 | game.Players.PlayerAdded:Connect( function (player) |
138 | game.ReplicatedStorage.AdminEvents.PlayerJoin:FireAllClients(player.Name) |
--//AdminHander\--
01 | local gui = script.Parent |
02 | local frameOutLine = gui.AdminPanelOutline |
03 | local adminFrame = frameOutLine.AdminPanel |
04 | local moderationframe = adminFrame.ModerationFrame |
05 | local UserBoard = frameOutLine.UserBoard.UserNames |
06 | local moneyFrame = frameOutLine.MoneyFrameOutline |
07 | local moneyPanel = moneyFrame.MoneyFrame |
08 | local inputAmount = moneyPanel.MainFrame.InputAmount |
09 | local moneyConfirm = moneyPanel.MainFrame.MoneyConfirm |
10 | local moneyFrameOpen = frameOutLine.MoneyFrameOpen |
11 | local moneyFrameClose = moneyFrame.MoneyFrameClose |
16 | game.ReplicatedStorage.AdminEvents.PlayerJoin.OnClientEvent:Connect( function (playerName) |
18 | local clone = script.TextButton:Clone() |
20 | local UIS = game:GetService( "UserInputService" ) |
21 | local GuiService = game:GetService( "GuiService" ) |
23 | clone.Name = playerName |
24 | clone.Text = playerName .. " ?????" |
25 | clone.PlayerValue.Value = playerName |
27 | if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled |
28 | and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then |
29 | clone.Text = playerName .. " ????" |
32 | clone.Parent = UserBoard |
35 | inputAmount:GetPropertyChangedSignal( "Text" ):Connect( function () |
36 | if inputAmount.Text = = "" then |
39 | inputAmount.Text = inputAmount.Text:gsub( '%D+' , '' ); |
40 | inputAmount.Text = inputAmount.Text:sub( 1 , 7 ) |
41 | print ( "Limited Input." ) |
44 | function keyPressed(input) |
45 | if input.KeyCode = = Enum.KeyCode.L then |
48 | frameOutLine.Visible = true |
52 | frameOutLine.Visible = false |
58 | moneyFrameOpen.MouseButton 1 Down:Connect( function () |
61 | moneyFrame.Visible = true |
62 | moneyFrameOpen.Visible = false |
67 | moneyFrameClose.MouseButton 1 Down:Connect( function () |
68 | if flag 2 = = false then |
70 | moneyFrame.Visible = false |
71 | moneyFrameOpen.Visible = true |
76 | game:GetService( "UserInputService" ).InputBegan:Connect(keyPressed) |
78 | moneyConfirm.MouseButton 1 Down:Connect( function () |
79 | game.ReplicatedStorage.AdminEvents.AddMoneyEvent:FireServer(moderationframe.InputPlayerName.Text, inputAmount.Text) |
83 | moderationframe.ServerBanButton.MouseButton 1 Down:Connect( function () |
84 | game.ReplicatedStorage.AdminEvents.ServerBanEvent:FireServer(moderationframe.InputPlayerName.Text, moderationframe.InputBanKickReason.Text) |
88 | moderationframe.KickButton.MouseButton 1 Down:Connect( function () |
89 | game.ReplicatedStorage.AdminEvents.ServerKickEvent:FireServer(moderationframe.InputPlayerName.Text, moderationframe.InputBanKickReason.Text) |
93 | moderationframe.GlobalBanButton.MouseButton 1 Down:Connect( function () |
94 | game.ReplicatedStorage.AdminEvents.GlobalBanEvent:FireServer(moderationframe.InputPlayerName.Text, moderationframe.InputBanKickReason.Text) |