Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ow do i make my script work when im on the pad?

Asked by 8 years ago

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)
0
It would be a lot easier to help you if you used a code block. User#11440 120 — 8y

Answer this question