So I’m making a camping game but I run into this problem “Attempt to call a string value”
Here is the script, the problem is on Line 41
local Gui = game.StarterGui:FindFirstChild("DialogGui")
local Frame = Gui:FindFirstChild("Frame")
local TextValue = game.ReplicatedStorage:FindFirstChild("TextValue")
local SpeakerText = Frame:FindFirstChild("Title")
local PlayerImage = Frame:FindFirstChild("PlayerImage")
local RandomPlayer
local Text
function TypeSound()
local Sound = Instance.new("Sound")
Sound.Parent = game.Workspace
Sound.Name = "TypeSound"
Sound.SoundId = "http://www.roblox.com/asset/?id=3333976425"
Sound.PlaybackSpeed = 1
Sound.Volume = 0.5
Sound:Play()
coroutine.resume(coroutine.create(function()
wait(1)
Sound:Destroy()
end))
end
function Text(word)
Text = word
for i = 1, #Text do
TextValue.Value = string.sub(Text, 1, i)
TypeSound()
wait(0.05)
end
end
wait(20)
print("Running Text")
Frame.Visible = true
RandomPlayer = game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())]
SpeakerText.Text = RandomPlayer.Name
Text("Hello and welcome to Part 9!")
PlayerImage.Image = game.Players:GetUserThumbnailAsync(RandomPlayer.userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
wait(5)
SpeakerText.Text = RandomPlayer.Name
Text("I am a random player!")
wait(5)
Frame.Visible = false
print("Finish")
If you’re wondering, this is what the properties look like
Note I make the text change through the Value in ReplicatedStorage because if I hook up the text straight to the TextLabel it causes bugs, but that’s not a concern.
I’ve been trying to fix this for the past 30 or so minutes but come into more problems. I understand that the solution might be simple but I would appreciate help