|
| 26 Jun 2015 06:28 PM |
Hi im trying to make this script check if the key exsits but it tells me theres and error on this line: if player.Backpack.Key ~= nil then
it only has this error if i don't have the key. but if I have the key there is no errors
workspace.Farmer.Head.Start.DialogChoiceSelected:connect(function(player, choice) if (choice == script.Parent.Start.Yes) then if player.Backpack.Key ~= nil then workspace.Farmer.Head.Start.Yes.Here.ResponseDialog = "Thank You" elseif player.Backpack.Key == nil then workspace.Farmer.Head.Start.Yes.Here.ResponseDialog = "You Don't Have it" end end end) |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2015 06:30 PM |
key = player.Backpack:FindFirstChild("Key")
if key ~= nil then
it only has this error if i don't have the key. but if I have the key there is no errors
workspace.Farmer.Head.Start.DialogChoiceSelected:connect(function(player, choice) if (choice == script.Parent.Start.Yes) then if key ~= nil then workspace.Farmer.Head.Start.Yes.Here.ResponseDialog = "Thank You"
elseif key == nil then workspace.Farmer.Head.Start.Yes.Here.ResponseDialog = "You Don't Have it" end end end) |
|
|
| Report Abuse |
|
|
| |
|