function HighnessManager:AddHighness(player, amount) local highness = player:FindFirstChild("Highness") if not highness then return end highness.Value = math.min(BluntData.BluntConfig.HighnessMax, highness.Value + amount) self:UpdateClient(player, highness.Value)
local function onHighnessUpdate(highnessValue) local intensity = highnessValue / 100 applyScreenEffect(intensity) Roblox - Advanced Weed Blunt System
hitEvent.OnServerEvent:Connect(function(player, bluntTool) if not bluntTool or not bluntTool.Parent == player.Character then return end local blunt = getBluntData(bluntTool) if not blunt:GetAttribute("IsLit") then return end highness.Value + amount) self:UpdateClient(player
if highness.Value >= BluntData.BluntConfig.PassOutThreshold then self:PassOut(player) end end false) end return tool end
-- Helper: Get or create blunt data from tool local function getBluntData(tool) local hitsLeft = tool:GetAttribute("HitsLeft") if not hitsLeft then tool:SetAttribute("HitsLeft", BluntData.BluntConfig.MaxHits) tool:SetAttribute("IsLit", false) end return tool end