Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Définition du dossier contenant toutes les informations des joueurs connecté sur le serveur actuel
- local Players = game.Players
- -- Définition du client du joueur qui exécute le script
- local Player = Players.LocalPlayer
- --
- -- Définition du PlayerGui du joueur
- local PlayerGui = Player:WaitForChild("PlayerGui")
- --
- -- Définiton du bouton de validation
- local ValidateButton = script.Parent
- --
- -- Définition de la "TextBox" contenant le nombre de "$" à donner au joueur cible
- local MoneyTextBox = PlayerGui:WaitForChild("AdminMenu"):WaitForChild("Main"):WaitForChild("AddMoney"):WaitForChild("AddMoneyTextBox")
- --
- -- Définition de la "TextBox" contenant l'ID du joueur cible pour pouvoir déterminer le joueur cible
- local IdTargetTextBox = PlayerGui:WaitForChild("AdminMenu"):WaitForChild("Main"):WaitForChild("AddMoney"):WaitForChild("TargetPlayer"):WaitForChild("PlayerId")
- --
- ValidateButton.MouseButton1Click:Connect(function()
- -- Définition des valeurs de la taille de l'écran par défaut
- local XDefaultScreenSize = 1918
- local YDefaultScreenSize = 1008
- --
- -- Module permettant d'obtenir la taille de l'écran du joueur
- local XScreenSize = game.Players.LocalPlayer:GetMouse().ViewSizeX
- local YScreenSize = game.Players.LocalPlayer:GetMouse().ViewSizeY
- --
- local function SendMoneyAdmin()
- -- On vérifie que l'éxécuteur soit bien Mochigoz
- if Players:GetPlayerByUserId(607212075) then
- local function GetNotifToTargetPlayer()
- if PlayerGui:FindFirstChild("NotifGui") then
- local NotifGui = PlayerGui:FindFirstChild("NotifGui")
- NotifGui:Destroy()
- end
- -- Création du Gui qui va accueillir le texte de la notification
- local NotifGui = Instance.new("ScreenGui")
- NotifGui.Name = "NotifGui"
- NotifGui.Parent = PlayerGui
- --
- -- Création du "TextLabel" qui va transmettre la notification au joueur
- local NotifTextLabel = Instance.new("TextLabel")
- NotifTextLabel.Name = "NotifTextLabel"
- NotifTextLabel.Parent = NotifGui
- -- Propriétés du "TextLabel"
- NotifTextLabel.TextColor3 = Color3.new(170/255, 0/255, 0/255)
- NotifTextLabel.BackgroundTransparency = 1
- NotifTextLabel.Size = UDim2.fromOffset(XScreenSize/(XDefaultScreenSize/800), YScreenSize/(YDefaultScreenSize/200))
- NotifTextLabel.Position = UDim2.fromScale(XScreenSize/(XDefaultScreenSize/0.3), YScreenSize/(YDefaultScreenSize/0.025))
- NotifTextLabel.Font = 36
- NotifTextLabel.TextScaled = true
- NotifTextLabel.RichText = true
- -- On dit à l'éxécuteur que l'argent a bien été donné
- NotifTextLabel.Text = "L'argent a été donné !"
- -- On attend deux secondes pour ensuite...
- wait(2)
- -- Supprimer la notification
- NotifGui:Destroy()
- end
- GetNotifToTargetPlayer()
- else
- Player:Kick("Vous avez été exclus par l'Anti-Cheat pour tentative de triche")
- end
- end
- SendMoneyAdmin()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement