I am a new to scripting and stuff and basically i was making an npc talk and then this happened it says Expected identifer got local and i don't know how to fix it broke all my npcs in the game
--Click detectors local shopguy = workspace.Map.Tom.ClickDetector local talkguy = workspace.Map.Ayee_Hoops.ClickDetector local talkdude = workspace.Map.SKIPPYDINGLECHALK121.ClickDetector local talkgirl = workspace.Map.Zertabyte.ClickDetector local talkman = workspace.Map.coomabsorber16.ClickDetector local talkkid = workspace.Map.HyperFinder. local storage = game.Workspace.storage.ClickDetector (the local is red) local gyro = game.Workspace["Gyro"].ClickDetector
--Other stuff local gui = script.Parent.DialogueGUI local NPCname = gui.NPCName.Text local dialogue = gui.Dialogue.Text local dialoguedb = false
Player = game:GetService("Players")["LocalPlayer"] local playername = Player.Name local char = Player.Character local hum = char:WaitForChild("Humanoid")
--Events local repstorage = game:GetService("ReplicatedStorage") local zeppelievent = repstorage.ZeppeliInteract local hamonevent = repstorage.GiveSpin
--Data Detection local stand = Player:WaitForChild("Data")["Stand"]
--Functions local askforspincd = false gyro.MouseClick:Connect(function() if askforspincd == true then return end askforspincd = true if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Gyro Zepelli" local line1 = "So. You wish to learn the ways of spin, But i will require some money. If i fail to give you spin, you don't have enough money for it." local line2 = "If you do have 50K However,i will teach you the ways of spin. Hope you are good at math." local voice = game.Workspace.SoundLibrary.Voice:Clone() voice.Parent = gyro.Parent.Head voice.SoundId = "rbxassetid://614988122" for i = 1, #line1 do dialogue.Text = string.sub(line1, 1, i) wait(0.05) voice:Play() end wait(1) for i = 1, #line2 do dialogue.Text = string.sub(line2, 1, i) wait(0.05) voice:Play() end hamonevent:FireServer() wait(3) gui.Enabled = false dialoguedb = false voice:Destroy() wait(500) askforspincd = false end end)
shopguy.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Tom" local line1 = "Wanna buy somethin'?"
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = shopguy.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
local shopgui = script.Parent.ShopGUI
shopgui.Enabled = true
end
end)
talkguy.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Hoops" local line1 = "Look at these fools." local line2 = "Pathetic." local voice = game.Workspace.SoundLibrary.Voice:Clone() voice.Parent = talkguy.Parent.Head voice.SoundId = "rbxassetid://614988122" voice.PlaybackSpeed = 1.25 for i = 1, #line1 do dialogue.Text = string.sub(line1, 1, i) wait(0.05) voice:Play() end wait(1) gui.Enabled = false dialoguedb = false voice:Destroy() end end)
talkdude.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Skippy" local line1 = "Oh don't mind me."
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = talkdude.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
end
end)
talkgirl.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Zerta" local line1 = "I enjoy watching people around me suffer :)."
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = talkgirl.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
end
end)
talkman.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Toucan" local line1 = "Every day is enternal suffering."
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = talkman.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
end
end)
talkkid.MouseClick:Connect(function() if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Hyper" local line1 = "I can almost find everything except my dad."
local voice = game.Workspace.SoundLibrary.Voice:Clone()
voice.Parent = talkkid.Parent.Head
voice.SoundId = "rbxassetid://614988122"
voice.PlaybackSpeed = 1.25
for i = 1, #line1 do
dialogue.Text = string.sub(line1, 1, i)
wait(0.05)
voice:Play()
end
wait(1)
gui.Enabled = false
dialoguedb = false
voice:Destroy()
end
end)
local askforstoragecd = false storage.MouseClick:Connect(function() if askforstoragecd == true then return end askforstoragecd = true if not dialoguedb then dialoguedb = true gui.Enabled = true NPCname.Text = "Stand Storage" local line1 = "So. You wish to use the stand storage?" local line2 = "ok" local voice = game.Workspace.SoundLibrary.Voice:Clone() voice.Parent = gyro.Parent.Head voice.SoundId = "rbxassetid://614988122" for i = 1, #line1 do dialogue.Text = string.sub(line1, 1, i) wait(0.05) voice:Play() end wait(1) for i = 1, #line2 do dialogue.Text = string.sub(line2, 1, i) wait(0.05) voice:Play() end local cool = game.Players.LocalPlayer.PlayerGui.StorageGUI cool.Enabled = true wait(3) gui.Enabled = false dialoguedb = false voice:Destroy()
wait(30)
askforstoragecd = false
end
end)
