|
| 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 |
|
|
|
| 26 Aug 2017 01:34 AM |
"script.Parent.Script.Disabled = true" wat
|
|
|
| Report Abuse |
|
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| 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 |
|
|