alrighty mctighty so in im trying to get this script to fire the event based off of the SD value like if it is set to 2 they can drop 2 "bombs in within a 5 second timeframe and after that timeframe is up they can place another 2 in that 5 second timeframe.... ok i cant really explain this off the top of my head but like in Bomberman when you pick up a "bombup" you can drop 1 more bomb than you could have before but you have to wait until the first one that you dropped has exploded and the way i have my bombs set up is the event triggers and creates the bomb and beeps 3 times then explodes which all happens in exactly 5 seconds.. if you can understand what im trying to say here then props to you
the game im working on is here https://www.roblox.com/games/2706427178/Pre-Alpha-God-Of-Bombs if you want to mess around with how i already got things set up
localscript:
local UIS = game:GetService("UserInputService") local FocusedTextBox = UIS:GetFocusedTextBox() local player = game.Players.LocalPlayer local character = player.CharacterAdded:wait() local humanoid = character:WaitForChild("Humanoid") local RootPart = character.HumanoidRootPart local Spot = RootPart.Position local BombDropped = false local SD = player.SnoopDogg UIS.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard or input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.F or input.KeyCode == Enum.KeyCode.ButtonX then if UIS:GetFocusedTextBox() == nil then if not BombDropped then BombDropped = true -- for i=SD.Value, 10, 0.5 do -- use for gamemodes -- print(i) -- for i = 1, SD.value, 0.5 do game.ReplicatedStorage.DropBomb:FireServer(Spot,RootPart) wait(5) -- end BombDropped = false end end end end end)
Ok so just spitballing here, I don't know if it'll work or not. The only concern I have is whether or not the bomb dropping part will continue to work while the while loop is running. If not you could I guess make the MaxBombs/Bombs variables save into the player and reset the Bombs value in a different script?
local UIS = game:GetService("UserInputService") local FocusedTextBox = UIS:GetFocusedTextBox() local player = game.Players.LocalPlayer local character = player.CharacterAdded:wait() local humanoid = character:WaitForChild("Humanoid") local RootPart = character.HumanoidRootPart local Spot = RootPart.Position local BombDropped = false local SD = player.SnoopDogg local MaxBombs = 2 local Bombs = 0 UIS.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard or input.UserInputType == Enum.UserInputType.Gamepad1 then if input.KeyCode == Enum.KeyCode.F or input.KeyCode == Enum.KeyCode.ButtonX then if UIS:GetFocusedTextBox() == nil then if Bombs.Value < MaxBombs.Value then Bombs.Value = Bombs.Value + 1 game.ReplicatedStorage.DropBomb:FireServer(Spot,RootPart) end end end end end) while wait(5) do Bombs.Value = 0 end