Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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.

01-- this is the problem I'm having (this is the part I step onto)
02local d = true -- d = debounce
03script.Parent.Touched:connect(function(hit)
04    if d and hit.Parent:FindFirstChild("Humanoid") and script.Parent.BrickColor~=BrickColor.Green() then
05        d=false
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()
13    wait()
14        d=true
15    end
View all 25 lines...

-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.

1 answer

Log in to vote
0
Answered by 8 years ago
1game:GetService'StarterGui':SetCore('ResetButtonCallback', false)

-Found my own answer to this problem lol

Ad

Answer this question