Hey guys, Just wanted to start making some basic scripts but am basically full blown noob in this area, what i want to do is
1. check player distance to object
2. if player is within said distance allow an action to happen if a key is pressed, sort of as follows with script attached to a tree
starting variable of each tree would be 5 on starting
if PlayerDistance <50 then
if KeyPressE =1 then
wood = wood + 1
tree = tree - 1
end
else
end
else
end
if tree == 0 then
destroy(tree) -- the one that the script is attached to and not all trees
else
end
any help appreciated, just thinking along the lines of a survival game where you collect resources, cheers