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

Why, wont this help command work?

Asked by 9 years ago

So I am trying to make a help command for all players, but this part seems not to work.

01local BotMessage = game.Workspace.Help_Loader.BotMessage
02local mr = math.random(1,3)
03local plr = game.Players.LocalPlayer
04 
05game.Players.PlayerAdded:connect(function(player)
06    player.Chatted:Connect(function(msg)
07        if msg == "Bot" or "Bot, I need help" or "Bot, help" then
08                if mr == 1 then
09                BotMessage.Visible = true
10                BotMessage.Text = plr.Name..", how may I help you?"
11                wait(2)
12                print("Success")
13                BotMessage.Visible = false
14                BotMessage.Text = "  "
15 
View all 37 lines...
0
Is BotMessage a BillBoardGui or SurfaceGui? M39a9am3R 3210 — 9y
0
It's in the script but I want it to be on the screen though, even though I tried a ScreenGUI. FederalJustice 35 — 9y
0
So it is a GUI within the script? And you want it to appear to the player who calls for a bot, correct? Is this a Server Script or LocalScript? M39a9am3R 3210 — 9y
0
Regular script, but it is a textLabel unless it is suppose to be a GUi within the script, is it? FederalJustice 35 — 9y

3 answers

Log in to vote
0
Answered by 9 years ago

In the first line, try changing it to:

1local BotMessage = game.Workspace["Help_Loader"].BotMessage

And you set Variable "plr" to the LocalPlayer so make sure you're using a Local Script because it does not work in server scripts.

Instead u could set the "Player" parameter from your PlayerAdded function to the "plr" variable, like this:

1game.Players.PlayerAdded:connect(function(Player)
2local plr = Player
3-- Code --
4end)
Ad
Log in to vote
0
Answered by
beader 0
9 years ago

Where does it go wrong exactly?

0
Look below for what I posted and this is what I found FederalJustice 35 — 9y
Log in to vote
0
Answered by 9 years ago

In line 6 it says:

1player.Chatted:Connect(function(msg)

See where the Connect is it is suppose to be connect, BUT it doesn't show an error but it wont work still.

Answer this question