function BoatModule:moveBoat(boat, userInput) -- Calculate the force to apply based on user input local force = Vector3.new(userInput.Forward.X, 0, userInput.Forward.Z)
return PlayerModule The TreasureModule generates and handles treasure-related mechanics. It uses a combination of random number generation and predefined treasure models to create a varied and exciting experience. Treasure Generation The treasure generation system uses random number generation to select a treasure model and position it in the game world.
-- TreasureModule.lua
local TreasureModule = {}
return boat end
-- BoatModule.lua
-- Position the treasure in the game world treasure.CFrame = CFrame.new(math.random(-100, 100), 10, math.random(-100, 100)) build a boat for treasure script
-- Create a new treasure instance local treasure = Instance.new("Model") treasure.Name = treasureModel