So I made this script. But it seem not to work.
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
gui = script.Parent
Button = gui.Button
Open = false
script.Parent.Activated:connect(function()
local dinnertime = script.Parent.Parent.Humanoid:LoadAnimation(script.eat)
dinnertime:Play()
end)
function PressE(key)
if (key == "E")
button.Visible = true
Open = true
elseif (Open == true) then
button.Visible = false
Open = false
end
end
end
Mouse.KeyDown:connect(PressE)
What I trying to do here is that I want the player that can click and to key event by pressing E. But when I saw something in the script the word button is seem to be red underline. And I trying to make like the player to press the E and get to click then after that it plays a animation WITH the TOOL.
I don't know how it's not working.
And here are some pictures to know what I am doing. And I am also doing it in a billboard way.
And I trying to make where the person also walk to it. It appears but when the player walk away it disappear.
https://gyazo.com/6509e48c4204923a7c4b78cb1c75ca45 https://gyazo.com/df935ee2611f221c572f256fe5e2f515 https://gyazo.com/c5bf5000f2acaef03f799029c6f81d2c
