Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's the problem with this?

error is FireServer is not a valid member of RemoteFunction Script 'players.player1.playergui.sidebar.buttons.donate.donatebackg', Line 38 stack end

local Plr = game.Players.LocalPlayer
local Globals = require(game.Workspace["Globals"])
local Name = script.Parent:WaitForChild("Name")
local Amount = script.Parent:WaitForChild("Amount")
local Send = script.Parent:WaitForChild("Send")
local DonateButton = script.Parent.Parent
local ButtonP = Globals.GetButton(Plr)

DonateButton.MouseButton1Click:connect(function()
	script.Parent.Visible = not script.Parent.Visible
	if not script.Parent.Visible then
		Globals.DeleteGui(Plr,"PrivateSelling")
	else
		for i,v in pairs(DonateButton.Parent:GetChildren()) do
			if v ~= DonateButton then
				v:GetChildren()[1].Visible = false
			end
		end
	end
end)

Globals.BPreference(Send,ButtonP)
Globals.BPreference(DonateButton,ButtonP)
Globals.BPreference(script.Parent,Globals.GetBackground(Plr))
Globals.ColorPreference(DonateButton,Globals.GetColor(Plr),"TextColor3")

Amount.Changed:connect(function()
	if tonumber(Amount.Text) then
		Amount.Text = math.abs(Amount.Text)
	end
end)

Send.MouseButton1Click:connect(function()
	local Donatee = Globals.FindPlayer(Name.Text)
	if Donatee and tonumber(Amount.Text) then
		local Donation = math.abs(Amount.Text)
		if Globals.GetRobux(Plr) >= Donation then
			workspace["AwardRobux"]:FireServer({Donatee,Donation,false}) 
			workspace["RemoveRobux"]:FireServer({Plr,Donation,false})
			coroutine.resume(coroutine.create(function()
				Globals.Notify(Plr,nil,"Donated "..Donation.." to "..Donatee.Name.."!",7)
			end))
			Globals.Notify(Donatee,nil,Plr.Name.." has donated "..Donation.." to you!",7)
		else
			Globals.Notify(Plr,nil,"Not enough robux!",7)
		end
	elseif not Donatee then
		Globals.Notify(Plr,nil,Name.Text.." not found!",7)
	elseif not tonumber(Amount.Text) then
		Globals.Notify(Plr,nil,"Numbers only!",7)
	end
end)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.