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

VIP Line 7 returns to a nil value?

Asked by 11 years ago

Workspace.VIP.VIPDoorScript:7: attempt to index global 'Players' (a nil value)

Thats what it says in the output.

01VIP = game.Workspace.VIP
02 
03TShirt = game.Workspace.TShirt
04ID = TShirt.Graphic
05 
06function onTouched(hit)
07    if Players.TShirt.ID == "http://www.roblox.com/The-Games-VIP-T-shirt-item?id=154826128" then
08        VIP.Transparency = 1
09        VIP.CanCollide = false
10        wait(2)
11        VIP.Transparency = 0
12        VIP.CanCollide = true
13    else
14        if Players.TShirt.ID ~= "http://www.roblox.com/The-Games-VIP-T-shirt-item?id=154826128" then
15            game.Workspace.Players:GetPlayers("Humanoid")
View all 21 lines...

I don't see whats the problem? Why?

1 answer

Log in to vote
2
Answered by 11 years ago

You haven't defined what 'Players' is.

1local Players = game.Players:GetPlayerFromCharacter(hit.Parent)

Put that just under the start of the function.

0
Ahh! Thanks! Roboy5857 20 — 11y
Ad

Answer this question