generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Alarm Sound!

Previous Thread :: Next Thread 
NickAtNick is not online. NickAtNick
Joined: 22 Dec 2015
Total Posts: 35
26 Aug 2017 01:12 AM
Hi, so I am a script learner and I wanted to make an Alarm Sound when A Prisoner goes through a brick but not the Polices!

player = script.Parent.Parent.Parent.Parent == false
police = player.TeamColor == BrickColor("Bright blue")
prisoner = player.TeamColor == BrickColor("Neon orange")

local function onTouch(hit)
if player == true then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
game.StarterGui.Alarming.Frame.Visible = false
wait(60)
script.Parent.Script.Disabled = false
game.StarterGui.Alarming.Frame.Visible = true
print("Prisoner")
elseif police == true then print("Police")
end
end

script.Parent.Touched:connect(onTouch)

Please someone help me with this script!
Report Abuse
PuffoThePufferfish is online. PuffoThePufferfish
Joined: 19 Jan 2013
Total Posts: 362
26 Aug 2017 01:34 AM
"script.Parent.Script.Disabled = true"
wat


Report Abuse
NickAtNick is not online. NickAtNick
Joined: 22 Dec 2015
Total Posts: 35
26 Aug 2017 01:47 AM
?????
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Aug 2017 02:38 AM
police = BrickColor("Bright blue")
prisoner = BrickColor("Neon orange")


local function onTouch(hit)
local player;
local police;
if hit.Parent:FindFirstChild("Humanoid") then
player = game.Players:GetPlayerFromCharacter(hit.Parent);
end
if player ~= nil then
if player.TeamColor == police then
police = true
else
police = false
end
end
if player ~= nil then
if police == false then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
game.StarterGui.Alarming.Frame.Visible = false
wait(60)
script.Parent.Script.Disabled = false
game.StarterGui.Alarming.Frame.Visible = true
print("Prisoner")
elseif police == true then print("Police")
end
end
end

script.Parent.Touched:connect(onTouch)











try that bud
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Aug 2017 02:41 AM
police = BrickColor.new("Bright blue")
prisoner = BrickColor.new("Neon orange")


local function onTouch(hit)
local player;
local isPolice;
if hit.Parent:FindFirstChild("Humanoid") then
player = game.Players:GetPlayerFromCharacter(hit.Parent);
end
if isPolice~= nil then
if player.TeamColor == police then
police = true
else
isPolice= false
end
end
if player ~= nil then
if isPolice== false then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
player.PlayerGui.Alarming.Frame.Visible = false
wait(60)
script.Parent.Script.Disabled = false
player.PlayerGui.Alarming.Frame.Visible = true
print("Prisoner")
end
if isPolice== true then
print("Police")
end
end
end
end
end












That shoudl work., not other one

script.Parent.Touched:connect(onTouch)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Aug 2017 02:42 AM
police = BrickColor.new("Bright blue")
prisoner = BrickColor.new("Neon orange")


local function onTouch(hit)
local player;
local isPolice;
if hit.Parent:FindFirstChild("Humanoid") then
player = game.Players:GetPlayerFromCharacter(hit.Parent);
end
if isPolice~= nil then
if player.TeamColor == police then
police = true
else
isPolice= false
end
end
if player ~= nil then
if isPolice== false then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
player.PlayerGui.Alarming.Frame.Visible = false
wait(60)
script.Disabled = false
player.PlayerGui.Alarming.Frame.Visible = true
print("Prisoner")
end
if isPolice== true then
print("Police")
end
end
end
end
end









script.Parent.Touched:connect(onTouch)












last try, thinjk that works
Report Abuse
NickAtNick is not online. NickAtNick
Joined: 22 Dec 2015
Total Posts: 35
26 Aug 2017 09:26 AM
it didn't worked :(
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Aug 2017 04:45 PM
police = BrickColor.new("Bright blue")
prisoner = BrickColor.new("Neon orange")


local function onTouch(hit)
local player;
local isPolice;
if hit.Parent:FindFirstChild("Humanoid") then
player = game.Players:GetPlayerFromCharacter(hit.Parent);
end
if isPolice~= nil then
if player.TeamColor == police then
isPolice= true
else
isPolice= false
end
end
if player ~= nil then
if isPolice== false then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
player.PlayerGui.Alarming.Frame.Visible = false
wait(60)
script.Disabled = false
player.PlayerGui.Alarming.Frame.Visible = true
print("Prisoner")
end
if isPolice== true then
print("Police")
end
end
end
end
end





script.Parent.Touched:connect(onTouch)





I forgot to do something, there!
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Aug 2017 04:46 PM
police = BrickColor.new("Bright blue")
prisoner = BrickColor.new("Neon orange")


local function onTouch(hit)
local player;
local isPolice;
if hit.Parent:FindFirstChild("Humanoid") then
player = game.Players:GetPlayerFromCharacter(hit.Parent);
end
if player ~= nil then
if player.TeamColor == police then
isPolice= true
else
isPolice= false
end
end
if player ~= nil then
if isPolice == false then
script.Parent.Script.Disabled = true
game.Workspace.AlarmSound.Sound:Play()
player.PlayerGui.Alarming.Frame.Visible = false
wait(60)
script.Disabled = false
player.PlayerGui.Alarming.Frame.Visible = true
print("Prisoner")
end
if isPolice== true then
print("Police")
end
end
end
end
end





script.Parent.Touched:connect(onTouch)



lol sry I keep seeing something and i gotta fix.

THAT shoudl work
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image