I'm trying to make 2 scripts for a GUI that when I type a player's name in the Username box and an amount of money in the Amount box it gives them that amount of my currency, called Shards (My game is in the testing stages and I don't want all of my testers to grind through a game that would normally take hours to beat).
How can I make it work? (I'm not an expert in scripting, but I'm not a novice)
Local Script
local mf = script.Parent
local f = mf.Frame
local plr = game.Players.LocalPlayer
local u = f.Username.Text
local a = f.Amount.Text
local c = f.Click
c.MouseButton1Click:Connect(function(plr)
game.ReplicatedStorage.SecondaryEvents.Hidden.NormalEvent:FireServer(plr,u,a)
end)
ServerScript
game.ReplicatedStorage.SecondaryEvents.Hidden.NormalEvent.OnServerEvent:Connect(function(plr,u,a)
if plr.Name == "Bearturnedhuman" or "Timewizard16" then
local su = u
local sa = a
if game.Players:FindFirstChild(su) then
local ou = game.Players:FindFirstChild(u)
ou.hiddenstats.Shards.Value = ou.hiddenstats.Shards.Value + sa
end
end
end)

2 comments
Ok, I just made another answer. Try that :D
I've tested everything, and it works. If it still doesn't work, I'll make a model of the one i made and send it to you