Icy Sheet

-- Internal custom properties
local COMPONENT_ROOT = script:GetCustomProperty("ComponentRoot"):WaitForObject()

local trigger = script.parent

local _MWS    = nil
local _MA     = nil
local _BDW     = nil -- player's ground friction data
local _GF     = nil
local _BFF     = nil


function OnBeginOverlap(whichTrigger, player)
    UI.PrintToScreen("TOUCHED ICE SHEET")
    -- The player walks faster.
    player.maxWalkSpeed = _MWS * 1.53
    -- The player accelerates more quickly.
    player.maxAcceleration = _MA * 10
    -- The player takes longer to come to rest while walking.
    player.brakingDecelerationWalking = _BDW / 10
    -- Also they slide more!
    player.groundFriction = _GF / 10
    -- And more sliding - they have less grip on the ground when decelerating.
    player.brakingFrictionFactor = _BFF /8
end

function OnEndOverlap(whichTrigger, player)
    UI.PrintToScreen("LEFT ICE SHEET")
    player.maxWalkSpeed = _MWS
    player.maxAcceleration = _MA
    player.brakingDecelerationWalking = _BDW
    player.groundFriction = _GF
    player.brakingFrictionFactor = _BFF
end

Game.playerJoinedEvent:Connect(function(player) -- get our player object upon join 
    _MWS     = player.maxWalkSpeed
    _MA     = player.maxAcceleration
    _BDW     = player.brakingDecelerationWalking
    _GF     = player.groundFriction
    _BFF     = player.brakingFrictionFactor
    
    print (_MWS.." : ".._MA.." : ".._BDW.." : ".._GF.." : ".._BFF)
    
end)
trigger.beginOverlapEvent:Connect(OnBeginOverlap)
trigger.endOverlapEvent:Connect(OnEndOverlap)

Latest Posts

Emulation ProcessEmulation Process

  Record Locs for Emulation in Core Grab data. Here, I am recording x,yz, and name data to emulate. Next Convert to usable array for Core template data. Snippet>> Pattern  Core template replacement pattern: Path:[C:\Users\soandso\Documents\My Games\CORE\Saved\Maps\mycoregame\Data\Tree\Emulator_