What do you want to achieve? Keep it simple and clear!
I am trying to make a Self-CheckIn System for my Airline, which helps the player to check in and gives them a Boarding Pass.
What is the issue? Include screenshots / videos if possible!
I have successfuly made and installed it at one of my airports. However, when I place it in my other airport, it gives me this error: ServerScriptService.CheckIn_Handler:10: attempt to index nil with ‘Parent’
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried looking for solutions but haven’t found one.
The system makes use of a remote event.
While the teaming system works, the tool:Clone() function seems to not work after I added it to my other airport.
My script:
local checkin = game.ReplicatedStorage:WaitForChild("Changeteam")
checkin.OnServerEvent:Connect(function(plr, team)
plr.TeamColor = team
end)
local givetool = game.ReplicatedStorage:WaitForChild("GiveTools")
givetool.OnServerEvent:Connect(function(player, tool)
tool:Clone().Parent = player.Backpack
end)
Not sure what you mean, this is the output I get when I add print(tool).
Check in! - Server - Script:9
Economy Class - Server - CheckIn_Handler:10
ServerScriptService.CheckIn_Handler:11: attempt to index nil with 'Parent' - Server - CheckIn_Handler:11
Did it print your desired tool. Can you check if it the output is a class type of a tool. Try print(typeof(tool)). Would you mind to show the client script.
Instance - Server - CheckIn_Handler:10
ServerScriptService.CheckIn_Handler:11: attempt to index nil with 'Parent'
This is the client script:
local team = BrickColor.new("Camo") --Colour of the class
local event = game.ReplicatedStorage:WaitForChild("Changeteam")
local toolevent = game.ReplicatedStorage:WaitForChild("GiveTools")
local frame = script.Parent.Parent
local load = frame.Parent.Loading
local success = frame.Parent.Success
local sound = game.SoundService.Click
local ding = game.SoundService.Success
local tool = game.ReplicatedStorage:WaitForChild("Economy Class")
script.Parent.MouseButton1Click:Connect(function()
sound:Play()
frame.Visible = false
load.Visible = true
wait(math.random(2,5))
event:FireServer(team)
toolevent:FireServer(tool)
load.Visible = false
success.Visible = true
ding:Play()
wait(2)
success:TweenPosition(UDim2.new(0.5,0,-1.5,0))
wait(1)
for i = 0.4, 1, 0.05 do
frame.Parent.Blur.BackgroundTransparency = i
wait(0.1)
end
frame.Parent:Destroy()
end)