I'm trying to create a goal in ROBLOX:
db = false -- We make this variable, so that we can make sure Bright red Team doesn't instantly make Bright blue Team lose more than 1 point by just 1 Kick Off. script.Parent.Touched:connect(function(hit) -- When the script's parent (BlueGoal) is touched if hit and hit.Name == "Ball" and db == false then -- We need to know if the debounce is off, and if the part that touched BlueGoal is named 'Ball' db = true -- Turn debounce on, so that for the next 3 seconds we can't lose more than 1 point. message = Instance.new("Hint").Parent = Workspace -- Add a new Hint to the Workspace so that we know what's going on. message.Text = "Bright blue Team loses 1 point! Kick Off!" -- Set the Hint's Text accordingly and display the message. wait(3) -- We wait 3 seconds to make sure everyone can read the message. message:destroy() -- We hide the message by :destroy()ing it. db = false -- We turn debounce off again so that we can score more points. end end)
The problem is, it errors. :(
Workspace.BlueGoal.Script:6: unexpected symbol near '='
Please help.
You can't have 2 equal signs on the same line.
Also, Instance.new("Hint")
is not a thing on Roblox.
You should make your variables local like instead of db = false
do local db = false
Also, I've heard somewhere that you should set all your properties first and the last thing you should do is parent it which can increase performance.
This script is confusing. Explain what you're trying to do.