Welcome to my website! 630 views 10 months ago

Script

Script

-- RainTacoOwnerOnly.server.lua -- Nur der Game Owner darf Rain Taco Event starten (per Button) local Debris = game:GetService("Debris") local RunService = game:GetService("RunService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local SoundService = game:GetService("SoundService") -- === KONFIG === local CONFIG = { Duration = 30, -- Dauer des Events in Sekunden SpawnRate = 25, -- Tacos pro Sekunde MaxActiveTacos = 250, -- Limit, damit kein Lag entsteht SpawnHeight = 80, -- Höhe über EventArea TacoLifetime = 15, -- Sekunden bis Despawn RevenueMultiplier = 3, -- x3 Einkommen während Event PlayMusic = false, -- Musik abspielen? MusicSoundId = "", -- rbxassetid://... (falls vorhanden) } -- Stelle sicher, dass es einen globalen Multiplikator gibt if not ReplicatedStorage:FindFirstChild("GlobalRevenueMultiplier") then local v = Instance.new("NumberValue") v.Name = "GlobalRevenueMultiplier" v.Value = 1 v.Parent = ReplicatedStorage end local multVal = ReplicatedStorage.GlobalRevenueMultiplier -- Taco-Baustein local function buildTaco() local shell = Instance.new("WedgePart") shell.Size = Vector3.new(2.4, 0.7, 1.4) shell.Color = Color3.fromRGB(210, 180, 140) shell.Material = Enum.Material.Sand shell.Anchored = false shell.CanCollide = true shell.Name = "Taco" local filling = Instance.new("Part") filling.Size = Vector3.new(1.9, 0.4, 1.0) filling.Color = Color3.fromRGB(255, 235, 80) filling.Material = Enum.Material.Neon filling.Anchored = false filling.CanCollide = false filling.Parent = shell local weld = Instance.new("WeldConstraint") weld.Part0 = shell weld.Part1 = filling weld.Parent = shell return shell end -- Spawnt einen Taco local function spawnTaco(pos) local taco = buildTaco() taco.CFrame = CFrame.new(pos) taco.Parent = workspace Debris:AddItem(taco, CONFIG.TacoLifetime) end -- Zählt aktuelle Tacos local function countTacos() local count = 0 for _, obj in ipairs(workspace:GetChildren()) do if obj:IsA("BasePart") and obj.Name == "Taco" then count += 1 end end return count end -- Startet das Event local function startRainTacos(area) print("🌮 Rain Taco Event startet!") local oldMult = multVal.Value multVal.Value = CONFIG.RevenueMultiplier local music if CONFIG.PlayMusic and CONFIG.MusicSoundId ~= "" then music = Instance.new("Sound") music.SoundId = CONFIG.MusicSoundId music.Looped = true music.Volume = 0.3 music.Parent = SoundService music:Play() end local elapsed = 0 local accumulator = 0 local conn conn = RunService.Heartbeat:Connect(function(dt) elapsed += dt accumulator += dt * CONFIG.SpawnRate while accumulator >= 1 do accumulator -= 1 if countTacos() < CONFIG.MaxActiveTacos then local size = area.Size local center = area.CFrame local offsetX = (math.random() - 0.5) * size.X local offsetZ = (math.random() - 0.5) * size.Z local topY = size.Y/2 local pos = (center * CFrame.new(offsetX, topY + CONFIG.SpawnHeight, offsetZ)).Position spawnTaco(pos) end end if elapsed >= CONFIG.Duration then conn:Disconnect() multVal.Value = oldMult if music then music:Stop() music:Destroy() end print("✅ Rain Taco Event beendet.") end end) end -- Hol dir EventArea und Button local area = workspace:WaitForChild("EventArea") local button = workspace:WaitForChild("RainButton"):WaitForChild("ClickDetector") -- Nur Owner darf starten button.MouseClick:Connect(function(player) local ownerId = game.CreatorId -- ID des Game Owners if player.UserId ~= ownerId then warn(player.Name .. " hat versucht den Taco-Regen zu starten (keine Berechtigung).") return end if multVal.Value ~= 1 then player:Kick("🌮 Bitte warte, bis der aktuelle Taco-Regen vorbei ist.") return end startRainTacos(area) end)

Verifying you're human...