I want to be able to walk onto buyPad1 and press "e" to remove wall1 and wall1b. It only removes wall1 and wall1b when I'm touching wall1. How do I fix this?
CODE:
local partFind = game.Workspace local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
local CanChange = false Mouse.KeyDown:connect(function(key) if key:lower() == "e" then if CanChange == true then bought = false partFind.buyPad1.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then
if game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Points.Value >= 1000 and bought == false then bought = true game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Points.Value = game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.Points.Value-1000 partFind.wall1:Remove() game.Workspace.wall1b:Remove() end end end) end end end) partFind.buyPad1.Touched:connect(function() CanChange = true end) partFind.buyPad1.TouchEnded:connect(function() CanChange = false end)