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

[SOLVED] Why is the function never being done?

Asked by 1 year ago
Edited by T3_MasterGamer 1 year ago

I can't figure out why the code isn't running, it is inside a local script.

local dialog = workspace["Test SellNPC"].Head.Dialog


local function sellgold(player, choice)
    print("gold sold")
end


dialog.DialogChoiceSelected:Connect(sellgold)
0
Where is the script located? Jac_00b 157 — 1y
0
ServerScriptService SteakBites 5 — 1y
1
Ah, that is your issue. Localscripts cannot run in Serverscriptservice. I'd suggest putting it inside of StarterPlayerScripts, where localscripts can be run. Jac_00b 157 — 1y
0
worked, ty SteakBites 5 — 1y

Answer this question