Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help Making a Script for a a way to make fires and put them out?

How can I make certain models/buildings catch on fire at time intervals (That can also be put out with something like hoses/water) If possible could someone make up a script that starts fires and allows them to be put out and how would i put that into the game

(Im new to Game creation and any help is appreciated) also if possible a way to notify players that a fire has started Thank you

(Btw i am making an Emergency services roleplay/Simulator as my first game so could you please help me out o i can learn how to do this stuff )

2 comments

0

Is... Is this a request?

0

No im just asking if somone has time and wants to they can but im just mainly asking for help cause i have no idea what im doing

1 answer

Let's say the model is a house. Put a BoolValue in the house.

Now put a script in the house with something like this.

local BoolValue = script.Parent.BoolValue -- Tells the script where the BoolValue is

while true do -- This is repeated forever
	wait (600) -- Script pauses here for 10 minutes
	if BoolValue.Value == false then -- Checks if the building is not on fire
		BoolValue.Value = true -- Changes the building status to being on fire
	end
end

Now in a separate you will determine what being on fire does to the house.

local BoolValue = script.Parent.BoolValue -- Tells the script where the BoolValue is

BoolValue.Changed:Connect(function() -- Whenever the BoolValue is changed this function will run
	if BoolValue.Value == true then -- Checks if the building is on fire
		print"Put stuff here"
	end
end)

At the 'print"Put Stuff here"' part just put the code of what being on fire does. Here's an example that should make all parts that are children of the house have a fire on them, and be red.

for i,v in pairs(script.Parent:GetChildren()) do
	if v.ClassName == "Part" then
		local fire = Instance.new("Fire")
		fire.Parent = v
		v.BrickColor = BrickColor.new("Bright red")
	end
end

3 comments

0

Does this work if it is a model that i have found or do i have to make it and with the last part do i just put that where put stuff here is in the same form?

0

Do i put it all in one script or in another because putting them in seperate scripts they dont work??

0

You need to watch some scripting tutorials or something.

This discussion is preserved as it was. New answers, comments, and votes are closed.