Script Doesnt Repeat Itself And Breaks? (UPDATED SCRIPT)
Asked by
2 years ago Edited 2 years ago
im making a script that switches poses from a folder in replicatedStorage and a folder in workspace, and changes the value of the room to far, middle or close, you can close a curtain to stop the mosnter from killing you and resetting the script back to the start, but if u fail to you get kicked, but the script isn't working, It doesn't repeat the script once the monster goes back, if anyone could fix it, I would appreciate it,
Script (I updated the script a bit but it still doesn't repeat)
01 | local rep = game:GetService( "ReplicatedStorage" ).Monsters |
02 | local cur = script.Parent |
03 | local isCurtainOpen = workspace.Curtaians [ "IsClosed?" ] |
04 | local place = script.Parent.Banana |
06 | game.Players.PlayerAdded:Connect( function (plr) |
08 | wait(math.random( 35 , 60 )) |
09 | place.Value = "Middle" |
11 | rep.Middle.Parent = cur |
12 | wait(math.random( 35 , 60 )) |
14 | cur.Middle.Parent = rep |
15 | rep.Close.Parent = cur |
16 | isCurtainOpen.Parent.Hitbox.Tap:Play() |
18 | if place.Value = = "Close" then |
19 | if isCurtainOpen.Value = = true then |
21 | cur.Close.Parent = rep |
22 | isCurtainOpen.Parent.Hitbox.Tap:Stop() |
25 | if place.Value = = "Close" then |
27 | if isCurtainOpen.Value = = true then |
29 | cur.Close.Parent = rep |
30 | isCurtainOpen.Parent.Hitbox.Tap:Stop() |
33 | if place.Value = = "Close" then |
35 | if isCurtainOpen.Value = = true then |
37 | cur.Close.Parent = rep |
38 | isCurtainOpen.Parent.Hitbox.Tap:Stop() |