hey guys i am having trouble with this simple door script
01 | debounce = false |
02 |
03 | function onTouch(obj) |
04 | if debounce then return |
05 | end |
06 | if obj.Parent = = nil then return |
07 | end |
08 | if Players:playerFromCharacter(obj.Parent) = = nil |
09 | then return |
10 | end |
11 | debounce = true |
12 | script.Parent.Transparency = 0.9 |
13 | script.Parent.CanCollide = false |
14 |
15 | wait( 2 ) |
i am very new to scipting, 1st week, does it matter what name i put the brick as and also i put this script under the brick i want this to do it to if it matters
playerFromCharacter
isn't a valid method. I believe your looking for GetPlayerFromCharacter. You also forgot to define "player" on line 8.
01 | debounce = false |
02 | players = game.Players --You forgot to define "players" |
03 | function onTouch(obj) |
04 | if debounce then return |
05 | end |
06 | if obj.Parent = = nil then return |
07 | end |
08 | if players:GetPlayerFromCharacter(obj.Parent) = = nil --Changed to GetPlayerFromCharacter |
09 | then return |
10 | end |
11 | debounce = true |
12 | script.Parent.Transparency = 0.9 |
13 | script.Parent.CanCollide = false |
14 |
15 | wait( 2 ) |