Part 2 of My Reset Prevention: More Problems? Seems Simple But Cannot Solve?
Asked by
8 years ago Edited 8 years ago
Hey fellow ROBLOXian scripters. I'm working on this game, called Hoop Dreams, basically a basketball game with some few minor twists. It seems really complicated but it's not, I want the script to work so that when I touch the brick, it will not make my character die, it keeps doing that. I have my own reset preventer, but it only works when I do not step on the part. Please help! Thanks.
03 | script.Parent.Touched:connect( function (hit) |
04 | if d and hit.Parent:FindFirstChild( "Humanoid" ) and script.Parent.BrickColor~ = BrickColor.Green() then |
06 | local plr = game.Players:FindFirstChild(hit.Parent.Name) |
07 | hit.Parent.Humanoid.WalkSpeed = 0 |
08 | script.Parent.BrickColor = BrickColor.Green() |
09 | plr.Court.Value = script.Parent.Parent.Name |
10 | script.Parent.Parent.gotnext.Value = script.Parent.Parent.gotnext.Value + 1 |
11 | plr.PlayerGui.scoreboard:findFirstChild(script.Parent.Parent.Name).Visible = true |
12 | plr.TeamColor = BrickColor.DarkGray() |
19 | local plr = game.Players.LocalPlayer repeat wait() until plr.Character and plr.Character:FindFirstChild( "Humanoid" ) |
20 | local hum = plr.Character [ 'Humanoid' ] |
21 | hum.HealthChanged:connect( function (health) |
23 | hum.Health = hum.MaxHealth plr.Character:MakeJoints() |
-LukeGabrieI
P.S. Basically once I step onto it, it does not prevent my death. But when I don't step on it and try to reset my character, I do not die. But when I step onto this part (first script) it makes me reset.