I have a sword in lighting and have this as a local script in a text button
local button = script.Parent
button.Selected = true
local player = game.Players.LocalPlayer
local starterSword = game.lighting.ClassicSword
function onClicked()
if button.Selected == false then
script.Parent.Parent.Parent.Enabled = false
local playersword = starterSword:Clone()
playersword.Parent = player.Backpack
button.Selected = true
elseif
button.Selected = false
end
end
This is my script but nothing happens

6 comments
Use a code block next time, I'll try to help though.
Why is your Lighting not spelt with a capital L? This doesn't work because at your end line, you're doing an elseif function without adding then, change your elseif line to, 'else button.Selected = false'. Basically the elseif is starting a whole new statement, that's why we're going to use else.
So if you run this script it means you have to click the button 2 times in order to get your weapon.
thanks, I will try to use these fixes and see what happens
I put your code in a codeblock. It is expected that you do this yourself next time. https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site
ok i'm sorry for that