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

Help me with my Terminal please?

Im trying to make a terminal but evertime I get close to it, it doesnt work and nothing happens. Please tell me if their is anything wrong with it.



timeuntilwin = 1200 
totaltime = 1200 

raidteamcolor = "Really blue" 
defendteamcolor = "Really red" 
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 <= totaltime  and 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!" 
							wait(5) 
							winmsg:remove()
							
							script.Parent.BrickColor = BrickColor.new(defendteamcolor) 
							timeuntilwin = totaltime
						end 
					end 
				end 

2 answers

✓ Accepted answer

I see an ERROR in the script. Its not OnTouched, its onTouched. And I'm pretty sure you cant put a name inside a Color. You have to do like Color.new(1, 2 ,3); not a name.

1 comment

0

OnTouched is a function called by a event, if it had different capitalization then you may point it out but it's correct. And the color is the BrickColor name, the OP does not want the Color3 Value.

@MUSHR0OM You're incorrect, don't try to help if you don't know for sure, it won't help the OP at all.

@neo Is there any output?

2 comments

0

You can use the 'Post a command..." field to reply.

0

No he can't Trioxide, it's a 5 rep point permission...

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