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

How in the world, this keeps erroring? [PLEASE HELP!]

Asked by 10 years ago

Well I made this door that activates with spacebar once the players torso is touching the part defined, but the thing is the script will run find the door will open and close, but 2 things the user can "spam" the spacebar and break it and once the script runs once and i try to run it again it jitters and won't slide the right way, here is the link?

www.roblox.com/SH-item?id=163931688

01local open = script.Parent.Parent.DoorPart.Open
02local close = script.Parent.Parent.DoorPart.Closed
03 
04if script.Running.Value == true then
05return end
06script.Running.Value=true
07while true do wait(0.1)
08if open.Value == false then
09    print"Open"
10    for i = 1, 4.9, 0.1 do
11        script.Parent.CFrame=script.Parent.CFrame*CFrame.new(0.2,0,0)
12        wait()
13        wait(WaitTime)
14    open.Value=true
15    close.Value=false
View all 37 lines...
01local PLR = game.Players.LocalPlayer
02PLR.Character["Torso"].Touched:connect(function(hit)
03    if hit.Name == "DoorOpen" then
04 game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
05  if key == " " then
06   if hit.Parent.DoorPart.Script.Running.Value ~= false and hit.Parent.DoorPart.Open.Value ~= false then
07    print"OpenWithLocalScript"
08hit.Parent.DoorPart.Script.Disabled=false
09wait(5)
10hit.Parent.DoorPart.Script.Disabled=true
11else
12    if hit.Parent.DoorPart.Script.Running.Value ~= true then
13    return end
14end
15end
16end)
17    end
18end)
19 
20Door control script

1 answer

Log in to vote
1
Answered by 10 years ago

Script code, please. We kinda need it to fix it, sorry.

0
Fixxed, harvest109 0 — 10y
Ad

Answer this question