So i'm very new to scripting and I don't know anything pretty much. I'm wondering if it's possible to make a frame and inside insert a textbox with no text, and a textbutton with the text "give". What I want to know how to do if how to make it so when I type in a roblox username in the textbox, it checks if that roblox username [roblox player] is in the game and if they are in the game when I click give and their username is in the textbox in the "Wins" stat of leaderstat the stat increases by 1. I hope I said it clear enough to were someone can help me, thanks!
I'll try to help, I'm not sure if this will work though.
local Players = game:GetService("Players") game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(chr) local chrname = chr.Name if chrname = "Nitrolux200" then -- Grab Leaderstats, then change the leaderstat for the user by 1. end end) end)
Sorry that I had to cut a bit out, I'm sort of a beginner too, but I hope some of this code helped. I'm pretty sure the script can go in Workspace?
local frame = script.Parent local textbox = frame.TextBox local textbutton = frame.TextButton game.Players.PlayerAdded:Connect(function(player) textbutton.MouseButton1Click:Connect(function() local findplayer = Player:FindFirstChild(textbox.Text) if findplayer then findplayer.leaderstats.Coins.Value = findplayer.leaderstats.Coins.Value + 1 end end) end)