Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

attempt to perform arithmetic (add) on Instance and number?

I'm trying to make the value 1 so when It's clicked, The other script recognizes the value and plays a sound. Which the other script Is if BU.Value = 1 then Horn:Play()


local BU = script.Parent.BostonU
local BC = script.Parent.BostonC
local ND = script.Parent.Notre
local MIC = script.Parent.Michigan
local HAR = script.Parent.Harvard
local yale = script.Parent.Yale
local MIN = script.Parent.Min
local Quin = script.Parent.Quin


BU.MouseButton1Click:Connect(function()
	game.Workspace.TeamSelection.Bu.Value = game.Workspace.TeamSelection.Bu + 1
end)

1 answer

✓ Accepted answer

Line 12 you made game.Workspace.TeamSelection.Bu but it's an instance just like the error says, you need a value so do game.Workspace.TeamSelection.Bu.Value like you did as a first argument but better option is to use += so game.Workspace.TeamSelection.Bu.Value += 1.

This discussion is preserved as it was. New answers, comments, and votes are closed.