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

Help with dialog?

Asked by 8 years ago

Heyy im back again . I was working on a dialog script for my new game, and i get a error at line 7? My leaderboard has a the same thing as money. help?

local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)

local stats = player:FindFirstChild("leaderstats")
if not stats then return

local money = stats:FindFirstChild("money")
if not money then return

if choice == script.Parent.DialogChoice.ChoiceA Then
    if gold amount >= 0 then
        game.ReplicatedStorage.FishingPole:clone().Parent = player.Backpack
end)
0
Please place this in the code block. woodengop 1134 — 8y
0
no one going to help? ;/ jo3thebomb 12 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I edited the script a bit, I THINK it has to do with the fact that you did not use a period on the first line.. But I'll check.

local dialog = script.Parent.dialog.DialogChoiceSelected:connect(function(player, choice)

local stats = player:FindFirstChild("leaderstats") if not stats then return

local money = stats:FindFirstChild("money") if not money then return

if choice == script.Parent.dialog.DialogChoice.ChoiceA Then if gold amount > = 0 then game.ReplicatedStorage.FishingPole:clone().Parent = player.Backpack end)

Does this work for you?

0
Oh, just in case you don't know how to place text into the Code Block, simply highlight it and press the Code Block icon. User#9499 0 — 8y
0
That is not the problem. I got it all working, its the "local" by "money" line 7 jo3thebomb 12 — 8y
0
The 'local' wouldn't have made any difference dyler3 1510 — 8y
0
12:13:31.325 - Workspace.Test Dumb.Head.Dialog.DialogScript:7: unexpected symbol near 'local' error for proof sir. jo3thebomb 12 — 8y
Ad

Answer this question