of     1   

NickyJ3
#190008480Sunday, May 29, 2016 8:16 PM GMT

I scripted a terminal and I have a bug in it. I cannot find out what it is. Can anyone help? timeuntilwin = 1200 totaltime = 1200 raidteamcolor = "Really red" defendteamcolor = "Lime Green" h = Instance.new("Hint") function OnTouched(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil then if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(raidteamcolor) then script.Parent.BrickColor = BrickColor.new(raidteamcolor) end if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(defendteamcolor) then script.Parent.BrickColor = BrickColor.new(defendteamcolor) timeuntilwin = totaltime for i, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Hint") then v:remove() end end end end end script.Parent.Touched:connect(OnTouched) while true do wait() if script.Parent.BrickColor == BrickColor.new(raidteamcolor) then h.Parent = game.Workspace h.Text = "Raiders win in".." "..timeuntilwin if timeuntilwin 0 then wait(1) timeuntilwin = timeuntilwin - 1 end if timeuntilwin == 0 then h:remove() winmsg = Instance.new("Message") winmsg.Parent = game.Workspace winmsg.Text = "Raiders have won! Good luck next time!" wait(5) winmsg:remove() script.Parent.BrickColor = BrickColor.new(defendteamcolor) timeuntilwin = totaltime end end end ~Storm~
NickyJ3
#190008537Sunday, May 29, 2016 8:16 PM GMT

The defending team cannot recapture the terminal. ~Storm~
NickyJ3
#190008952Sunday, May 29, 2016 8:21 PM GMT

Bump. ~Storm~
NickyJ3
#190009684Sunday, May 29, 2016 8:30 PM GMT

God, C&G is more helpful than you. ~Storm~
Kodran
#190009776Sunday, May 29, 2016 8:31 PM GMT

What is a terminal and what are you trying to do.
Treble53
#190010068Sunday, May 29, 2016 8:35 PM GMT

I dont think anyone in their right mind would patrol this forum every second of every hour with the mission of helping helpless individuals with their cool little raycasts, generic terms or otherwise at the OPs convenience. (there may be some but they're not here obv lol) Find a friend, with scripting knowledge, get help that way. or wait patiently ofc :P
NickyJ3
#190010159Sunday, May 29, 2016 8:36 PM GMT

A terminal is essentially a capture point. A raiding force capture the terminal, and hold it for a designated time (1200 seconds) If the defending team recaptures, the raid continues on. But, the defending team cannot capture. That's the issue. ~Storm~
Kodran
#190010601Sunday, May 29, 2016 8:42 PM GMT

timeuntilwin = 1200 timeheld = 0 clr = nil script.Parent.Touched:connect(function(h) if h.Parent:FindFirstChild("Humanoid") then pclr = game.Players:GetPlayerFromCharacter(h.Parent).TeamColor if clr ~= pclr then clr = pclr timeheld = 0 script.Parent.BrickColor = BrickColor.new(pclr) end end end) while wait(1) do if clr ~= nil then timeheld = timeheld + 1 if timeheld >= timeuntilwin then print(clr..' wins') end end end
Kodran
#190010674Sunday, May 29, 2016 8:43 PM GMT

Not 100% sure if i grasp the concept but in my script the 'terminal' starts off neutral, whoever takes it and holds it for 1200 seconds wins, if someone takes it during that time the counter restarts.
NickyJ3
#190012697Sunday, May 29, 2016 9:09 PM GMT

Is there anyway you can have the terminal start on the defending team? And only the raiders have to hold it for 1200 seconds. The defenders must hold the terminal until the raiders leave which could be minutes or hours. ~Storm~
Kodran
#190013210Sunday, May 29, 2016 9:14 PM GMT

timeuntilwin = 1200 timeheld = 0 def = "Lime green" --Or whatever colour you want the defending team clr = BrickColor.new(def) script.Parent.Touched:connect(function(h) if h.Parent:FindFirstChild("Humanoid") then pclr = game.Players:GetPlayerFromCharacter(h.Parent).TeamColor if clr ~= pclr then clr = pclr timeheld = 0 script.Parent.BrickColor = pclr end end end) while wait(1) do if clr ~= nil then timeheld = timeheld + 1 if timeheld >= timeuntilwin and clr ~= BrickColor.new(def) then print(clr..' wins') end end end
NickyJ3
#190015072Sunday, May 29, 2016 9:36 PM GMT

Thank you very much. ~Storm~
NickyJ3
#190016011Sunday, May 29, 2016 9:47 PM GMT

One problem. It doesn't display how much time is on the clock. ~Storm~
Kodran
#190016163Sunday, May 29, 2016 9:49 PM GMT

while wait(1) do if clr ~= nil then timeheld = timeheld + 1 --Right here put the code to display the time on the clock, the time is called timeheld if timeheld >= timeuntilwin and clr ~= BrickColor.new(def) then print(clr..' wins') end end end
Luo_Basics
#190019739Sunday, May 29, 2016 10:29 PM GMT

its Lime green not Lime Green r+://393244197r+://393244224r+://393244262
Kodran
#190019889Sunday, May 29, 2016 10:31 PM GMT

^^ I fixed that in mine.
Luo_Basics
#190019942Sunday, May 29, 2016 10:32 PM GMT

i was just remarking what he did wrong, incase he didnt notice. r+://393244197r+://393244224r+://393244262
Kodran
#190020141Sunday, May 29, 2016 10:34 PM GMT

Yeah tru for future reference OP, generally brickcolors have the first word capitalized and the second all lower case like Bright blue and Bright red.

    of     1