Hello devs!
I want to change Image by using script but instead of inserting the correct image ID, he inserts nil.
Here is code (local script):
function animateText(text, characterName, characterImage)
DialogueFrame.Visible = true
local displayText = text
CharName.Text = characterName
CharImage.Image = "rbxassetid://"..tostring(characterImage)
if translator then
displayText = translator:Translate(Dialogue, text)
end
for i = 1, #displayText do
Dialogue.Text = string.sub(displayText, 1, i)
task.wait(0.01)
end
end
----------------------------------------
workspace.LeverSystem.Fairoutismissing.Level1.lever.ClickDetector.MouseClick:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
local char = game.Workspace.Map.Maps.Fairoutismissing.Poz1:WaitForChild("Fairout")
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local animation = -- animation path
local LoadedAnimation = animator:LoadAnimation(animation)
camera.CFrame = char.Parent.CameraPart1.CFrame
LoadedAnimation:Play()
LoadedAnimation:GetMarkerReachedSignal("FairoutDialogue1"):Connect(function()
animateText(DialogueModule.Dialogue1[1].Text, DialogueModule.Dialogue1[1].Name, DialogueModule.Dialogue1[1].Image)
end)
end)
DialogueModule is a Module Script