Walkable Wall Trigger

local trigger = script.parent

function OnBeginOverlap(trigger,other)
    -- must do local player check in client context (errors on multiple players)
    if other:IsA("Player") and other.name == Game.GetLocalPlayer().name then
        _G["gbon"] = true
        Events.BroadcastToServer("GBCheck",trigger.name)
    end
end


function OnEndOverlap(trigger,other) -- using Jump (SPACE) to detach now..
    if(other:IsA("Player"))then
        _G["gbon"] = false
        --Events.BroadcastToServer("GBStop",trigger.name) -- stops touching the wall
    end
end

trigger.beginOverlapEvent:Connect(OnBeginOverlap)
trigger.endOverlapEvent:Connect(OnEndOverlap)

Latest Posts