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

The Holo? again .-. I have tried lots of things[SOLVED] [closed]

Asked by 10 years ago
01a=game.Workspace.Holo.config
02b=a.RankId
03c=a.GroupId
04game.Players.PlayerAdded:connect(function(plr)
05if plr:GetRankInGroup(c.Value) >= b.Value then
06plr.Chatted:connect(function(msg)
07    if string.lower(msg) == "sf" then
08game.Lighting.Thing:Clone().Parent = game.Workspace
09    elseif string.lower(msg) == "close sf" then
10if game.Workspace:FindFirstChild("Thing") then
11game.Workspace.Thing:Remove()
12 
13 
14end
15end
16end)
17end
18end)

Says Workspace.Holo:5: attempt to index global 'player' (a nil value)' what am I doing wrong?This might be the last problem to my script

Locked by adark and evaera

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

I've already answered this.


Your function gets a variable called plr on line 4.

You then decide on line 5 to use a variable called player that hasn't come from anywhere. Since the argument is named plr, you have to use plr when you are referring to it.


On line 6 you use yet another name (Player -- names are case sensitive).

Use plr everywhere since that's what you decided to call it in the parameter.


The same goes for chat and msg. You're using chat but it doesn't come from anywhere! You decided to call it msg, you have to stick with that.

0
I have updated my script have I done something wrong now? Ex_plore 62 — 10y
0
I mean like is there anything else wrong? Ex_plore 62 — 10y
0
THANK YOU SO MUCH! Ex_plore 62 — 10y
Ad