My AppleScript script wont work I am a starter in AppleScript and there is an issue with my script I cant fix.

The script is: 

display dialog "How long do you want the timer to go for in seconds?" default answer ""

set time to "text returned"

display dialog "Click start to start." buttons {"Start", "Cancel"}

if the answer is equal to "Start" then
    delay "time"
end if
repeat 10 times
    beep
end repeat




The error message is "error "Can’t set time to \"text returned\"." number -10006 from time" (I am making a timer)
The following example AppleScript code is just to show changes made to your code to make it flow without the obvious errors that your code has. It does not include proper error handling as would be appropriate to handle all results of the logic flow. Keep learning!

display dialog "How long do you want the timer to go for in seconds?" default answer ""

set thisLong to text returned of result

display dialog "Click start to begin." buttons {"Cancel", "Start"} default button 2

if button returned of result is "Start" then
    delay thisLong
    repeat 10 times
        beep
    end repeat
end if