I am attempting to get the values of a tool which touches a part.
This is my current code.
I am attempting to make the following:
First, check if the part touching is actually the card and not a players arm for example,
then check if the card has enough cash, if 0, then do error 5.
then check if the card is disabled, if disabled, then do error 2,
then check if the card is in use, if it is in use, then do error 3,
finally check if the card is valid, if invalid, do error 1.
If non of these errors are met, then do the following function,
function accept()
Any ideas?
function isCardValid()
if script.Parent.Parts.Body.EPad.Touched:Connect(function(hit)
if hit.Name == "Oyster Card" then
if hit.Cash == 0 then
script.Parent.Parts.Display.LED.SurfaceGui.TextLabel.Text = "SEEK ASSISTANCE 05"
script.Parent.Sounds.Error:Play()
end
if hit.Disabled == true then
script.Parent.Parts.Display.LED.SurfaceGui.TextLabel.Text = "SEEK ASSISTANCE 02"
script.Parent.Sounds.Error:Play()
end
if hit.Inuse == true then
script.Parent.Parts.Display.LED.SurfaceGui.TextLabel.Text = "SEEK ASSISTANCE 03"
script.Parent.Sounds.Error:Play()
end
if hit.Valid == false then
script.Parent.Parts.Display.LED.SurfaceGui.TextLabel.Text = "SEEK ASSISTANCE 01"
script.Parent.Sounds.Error:Play()
end
else
print ("not valid")
end
end
) then