"My" script is underlining in blue? | Roblox Forum
Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

"My" script is underlining in blue?

Status
Not open for further replies.
Oct 19, 2019
116
5
18
Roblox
TrueFalses
Code:
local dialogue = game.ReplicatedStorage.Dialogue local type =
Enum.ThumbnailType.HeadShotlocal size = Enum.ThumbnailSize.Size180x180

function Message(player, speech, id) dialogue:FireAllClients(player, speech, id) end
wait(5) local players = game.Players:GetChildren() local player =
players[math.random(1, #players)] local id =
game.Players:GetUserThumbnailAsync(player.UserId, type, size) Message(player,"Example Here", id)
Can someone explain why this is happening, is it the placement, I wouldnt be suprised.. Thanks!

Blue underlines colored in blue.
Post automatically merged:

Enum.ThumbnailType.HeadShotlocal size

and

players[math.random(1, #players)] local id =
game.Players:GetUserThumbnailAsync(player.UserId, type, size)
 
Oct 19, 2019
116
5
18
Roblox
TrueFalses
"My" scripts, :3 .. *cough cough* how do I define ;-;
Post automatically merged:

I may need a script example >:)
 

PokyStuffed

Exemplar Member
Oct 9, 2019
1,411
317
83
the place where you least expect
Roblox
poky_stuffed
Whoever wrote this has a bad habit of crunching their code together to make it unreadable, lol
Post automatically merged:

so where are you defining "players" that is used on "local player = players[math.random(1, #players)]"?
maybe you want "Players" that is equal to game:GetService("Players")? aka game.Players
 
  • Hmm
Reactions: CampingHelpPlease
Oct 19, 2019
116
5
18
Roblox
TrueFalses
its not my script, found it online because I am too uneducated to learn myself lol. I'll define it right now.
 

Chef

Active Member
Nov 4, 2018
326
51
28
Kings Throne
Roblox
Cshef
local dialogue = game.ReplicatedStorage.Dialogue

local type = Enum.ThumbnailType.HeadShotlocal size = Enum.ThumbnailSize.Size180x180



function Message(player, speech, id) dialogue:FireAllClients(player, speech, id)

end

wait(5) local players = game.Players:GetChildren()

local player = players[math.random(1, #players)]

local id = game.Players:GetUserThumbnailAsync(player.UserId, type, size) Message(player,"Example Here", id)

should work. your script was formatted all wack
 

Chef

Active Member
Nov 4, 2018
326
51
28
Kings Throne
Roblox
Cshef
local dialogue = game.ReplicatedStorage.Dialogue

local type = Enum.ThumbnailType.HeadShotlocal size = Enum.ThumbnailSize.Size180x180



function Message(player, speech, id) dialogue:FireAllClients(player, speech, id)

end

wait(5) local players = game.Players:GetChildren()

local player = players[math.random(1, #players)]

local id = game.Players:GetUserThumbnailAsync(player.UserId, type, size) Message(player,"Example Here", id)

should work. your script was formatted all wack
Thanks, it worked! I didn't even define "Player", I am soo cheap, robloxforum is the best place to be to just lay back and wait people to give you the answers. Hah... *gulp* ill learn myself... one day :)
no problem, but yeah, ez fix
"you" were defining multiple variables in the same line/then splitting them up in different lines
 
  • Laugh
Reactions: CampingHelpPlease
Oct 19, 2019
116
5
18
Roblox
TrueFalses
Code:
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player

function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end end

dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name
    thumbnail.Image = id Message(speech) end)
There is this script aswell that looks fine and is located in the GUI
 

PokyStuffed

Exemplar Member
Oct 9, 2019
1,411
317
83
the place where you least expect
Roblox
poky_stuffed
Thanks, it worked! I didn't even define "Player", I am soo cheap, robloxforum is the best place to be to just lay back and wait people to give you the answers. Hah... *gulp* ill learn myself... one day :)
sorry, it actually was defined, but it was formatted so bad I missed it. seems like what @Chef did fixed it although I can't really see what he changed lol
 
Oct 19, 2019
116
5
18
Roblox
TrueFalses
your script was formatted all wack
understatement.
Post automatically merged:

oh yeah, what is this dialogue script supposed to do, btw?
It is suppose to make it soo that the game chooses a random player from the server and makes them talk where it shows the GUI, character avatar, and their dialog.
Post automatically merged:

Thanks, it worked! I didn't even define "Player", I am soo cheap, robloxforum is the best place to be to just lay back and wait people to give you the answers. Hah... *gulp* ill learn myself... one day :)
sorry, it actually was defined, but it was formatted so bad I missed it. seems like what @Chef did fixed it although I can't really see what he changed lol
Ohh, okay. Thats good that is fixed now, thanks for the help guys.
 

PokyStuffed

Exemplar Member
Oct 9, 2019
1,411
317
83
the place where you least expect
Roblox
poky_stuffed
"you" were defining multiple variables in the same line/then splitting them up in different lines
oh I see haha, it's really bad practice to code that way
Post automatically merged:

It is suppose to make it soo that the game chooses a random player from the server and makes them talk where it shows the GUI, character avatar, and their dialog.
ah, like they do in the camping games
 

Chef

Active Member
Nov 4, 2018
326
51
28
Kings Throne
Roblox
Cshef
Code:
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player

function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end end

dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name
    thumbnail.Image = id Message(speech) end)
There is this script aswell that looks fine and is located in the GUI
local dialogue = game.ReplicatedStorage.Dialogue

local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail
local text = frame.Dialogue
local player = thumbnail.Player

function Message(speech)
for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end
end

dialogue.OnClientEvent:Connect(function(plr, speech, id)
player.Text = plr.Name
thumbnail.Image = id Message(speech)
end)
 
Oct 19, 2019
116
5
18
Roblox
TrueFalses
"you" were defining multiple variables in the same line/then splitting them up in different lines
oh I see haha, it's really bad practice to code that way
Post automatically merged:

It is suppose to make it soo that the game chooses a random player from the server and makes them talk where it shows the GUI, character avatar, and their dialog.
ah, like they do in the camping games
.3. mhm
Post automatically merged:

Code:
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player

function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end end

dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name
    thumbnail.Image = id Message(speech) end)
There is this script aswell that looks fine and is located in the GUI
local dialogue = game.ReplicatedStorage.Dialogue

local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail
local text = frame.Dialogue
local player = thumbnail.Player

function Message(speech)
for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end
end

dialogue.OnClientEvent:Connect(function(plr, speech, id)
player.Text = plr.Name
thumbnail.Image = id Message(speech)
end)
gah, was just going to ask, i think this other script is incorrect xd
 

PokyStuffed

Exemplar Member
Oct 9, 2019
1,411
317
83
the place where you least expect
Roblox
poky_stuffed
Let me fix this other one for you:

Code:
local dialogue = game.ReplicatedStorage.Dialogue
local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail
local text = frame.Dialogue
local player = thumbnail.Player

function Message(speech)
    for i = 1, #speech do
        text.Text = string.sub(speech, 1, i)
        wait()
    end
end

dialogue.OnClientEvent:Connect(function(plr, speech, id)
    player.Text = plr.Name
    thumbnail.Image = id
    Message(speech)
end)
now it looks nicer :)

Edit: I fixed the formatting, who knows whether the actual code is correct or not
 
  • Like
Reactions: CampingHelpPlease

Chef

Active Member
Nov 4, 2018
326
51
28
Kings Throne
Roblox
Cshef
"you" were defining multiple variables in the same line/then splitting them up in different lines
oh I see haha, it's really bad practice to code that way
Post automatically merged:

It is suppose to make it soo that the game chooses a random player from the server and makes them talk where it shows the GUI, character avatar, and their dialog.
ah, like they do in the camping games
.3. mhm
Post automatically merged:

Code:
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player

function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end end

dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name
    thumbnail.Image = id Message(speech) end)
There is this script aswell that looks fine and is located in the GUI
local dialogue = game.ReplicatedStorage.Dialogue

local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail
local text = frame.Dialogue
local player = thumbnail.Player

function Message(speech)
for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end
end

dialogue.OnClientEvent:Connect(function(plr, speech, id)
player.Text = plr.Name
thumbnail.Image = id Message(speech)
end)
gah, was just going to ask, i think this other script is incorrect xd
yea that one should work
same mistake as before, but you were also ending the function on the same line when the line was still going
 
Oct 19, 2019
116
5
18
Roblox
TrueFalses
"you" were defining multiple variables in the same line/then splitting them up in different lines
oh I see haha, it's really bad practice to code that way
Post automatically merged:

It is suppose to make it soo that the game chooses a random player from the server and makes them talk where it shows the GUI, character avatar, and their dialog.
ah, like they do in the camping games
.3. mhm
Post automatically merged:

Code:
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player

function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end end

dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name
    thumbnail.Image = id Message(speech) end)
There is this script aswell that looks fine and is located in the GUI
local dialogue = game.ReplicatedStorage.Dialogue

local frame = script.Parent.Frame
local thumbnail = frame.Thumbnail
local text = frame.Dialogue
local player = thumbnail.Player

function Message(speech)
for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait()
end
end

dialogue.OnClientEvent:Connect(function(plr, speech, id)
player.Text = plr.Name
thumbnail.Image = id Message(speech)
end)
gah, was just going to ask, i think this other script is incorrect xd
yea that one should work
same mistake as before, but you were also ending the function on the same line when the line was still going
Ah.. k I get it now... wait wat o_O you? dont u mean "you"?!
Post automatically merged:

thanks to the guy who made a very helpful tutorial on how to do this :)

Code:
  16:09:53.456 - HeadShotlocal is not a valid EnumItem
16:09:53.458 - Stack Begin
16:09:53.459 - Script 'Workspace.Script', Line 3
16:09:53.463 - Stack End
16:09:58.296 - ContentProvider:PreloadAsync() failed for https://assetgame.roblox.com/Thumbs/GameIcon.ashx?assetId=4010828690&width=576&height=324&ignorePlaceMediaItems=true
  16:10:00.087 - Frame is not a valid member of Frame
16:10:00.089 - Stack Begin
16:10:00.091 - Script 'Players.unknown.PlayerGui.frame.Frame.LocalScript', Line 2
16:10:00.092 - Stack End
  Error checking in group: Player:GetRankInGroup failed because HTTP 400 (Bad Request)
:o

you know what it doesnt matter ill figure another way.. xd
 
Last edited:
Status
Not open for further replies.
General
Help Users
  • No one is chatting at the moment.
    InsertDeadMemeHere InsertDeadMemeHere: yee