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

Attempt to index upvalue?

Line 4 and Line 36 where the bug is

local player = game.Players.LocalPlayer

function onAccept()
	player.PlayerGui.MyGroup.groupid.Value = script.Parent.groupid.Value
	player.PlayerGui.Sidebar.Bin.Frame.Main.MyGroup.Label.Text = "Leave Group"
	local newgroup = game.Lighting.Groups:findFirstChild(script.Parent.groupid.Value)
	local groupstuff = newgroup:GetChildren()
	for k = 1, #groupstuff do
		if groupstuff[k].Value == "NoPlayer" then
			groupstuff[k].Value = player.Name
			local guises = player.PlayerGui:GetChildren()
			for mop = 1, #guises do
				if guises[mop].Name == "GroupInvite" and guises[mop] ~= script.Parent then
					guises[mop]:Destroy()
				end
			end
			local rejectedleader = game.Players:findFirstChild(script.Parent.leadername.Value)
			if rejectedleader then
			rejectedleader.PlayerGui.MessageSystem.NewMessage.Value = rejectedleader, "Blue", player.Name .. " has accepted your group invitation."
			end 
			script.Parent:Destroy()
		return end
	end
	local guises = player.PlayerGui:GetChildren()
	for mop = 1, #guises do
		if guises[mop].Name == "GroupInvite" then
			guises[mop]:Destroy()
		end
	end
	script.Parent:Destroy()
end 

function onDeny()
	local rejectedleader = game.Players:findFirstChild(script.Parent.leadername.Value)
	if rejectedleader then
    rejectedleader.PlayerGui.MessageSystem.NewMessage.Value = rejectedleader, "Blue", player.Name .. " has declined your group invitation."
	end 
	script.Parent:Destroy()
end 

script.Parent.Frame.Yes.MouseButton1Up:connect(onAccept)
script.Parent.Frame.No.MouseButton1Up:connect(onDeny)

1 comment

0

Its FindFirstChild not findFirstChild (just saying)

1 answer

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