I'm trying to define "plr", but I keep getting the error "attempt to index local 'plr' (a nil value)".
The error is on line 10.
Hierarchy: Lowest Descendant to Highest Descendant
Script
Create
Frame
Application
PlayerGui
Player
local create = script.Parent
local frame = create.Parent
local id = frame.groupID
local plr = script.Parent.Parent.Parent.Parent.Parent
local ap = require(game.Workspace.TrelloAPI)
create.MouseButton1Click:connect(function(plr)
if plr:GetRankInGroup(tonumber(id.Text)) == 255 then
local group = game:GetService("GroupService"):GetGroupInfoAsync(tonumber(id.Text))
local BoardID = ap:GetBoardID("Appalachian Security Contract Application")
local ListID = ap:GetListID("Applied",BoardID)
local id = id.Text
local CardID = ap:AddCard("[NS] " .. group.Name, plr.Name, id, ListID)
print("He's the owner!!!!")
wait(3)
plr:Kick("Thank you for choosing Appalachian Private Security Company, we hope you choose us again! -APSC")
script.Parent.Parent.create.Visible = false
else
print("He's NOT the owner!!!!")
script.Parent.Parent.Warn.Visible = true
script.Parent.Parent.create.Visible = false
script.Parent.Parent.groupID.Text = "Sorry, you MUST be the owner!"
script.Parent.Parent.groupID.TextColor3 = script.Parent.Parent.groupID.TextColor3(255, 0, 0)
wait(5)
script.Parent.Parent.groupID.Text = "Enter group ID here"
script.Parent.Parent.groupID.TextColor3 = script.Parent.Parent.groupID.TextColor3(0, 0, 0)
end
end)

1 comment
Sadly there are no parameter for the mouse that define a player (always nil). Instead, you can grab the player's mouse, using "player:GetMouse" (more on the "mouse" object ----> http://wiki.roblox.com/index.php?title=API:Class/Player/GetMouse)