I need a way to be able to when you press "e" it will make a Model disappear and give you 15 coins? My coins are called "Coins"
Put a LocalScript
into the StarterGui
::
wait() local UIS = game:GetService("UserInputService") local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats") local coins = leaderstats.Coins ----- Optional: Change this ------ local key = "E" local reward = 15 ------ Change this ------- local model = workspace.Model UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode[key] then coins.Value = coins.Value + reward model:Destroy() end end)
Right Here Is What I Concluded:
local Plr = game.Players.LocalPlayer local model = workspace.Test -- The Model To Hide local amountofcoins = 15 -- How Many Coins Earned Plr:GetMouse().KeyDown:Connect(function(Key) if Key == "e" then model:Destroy() Plr.leaderstats.Coins.Value = Plr.leaderstats.Coins.Value +1 end end)
Make Sure The Script Is Local!
If You Still Need Help DM Me: Harry_TheKing1#2303
Closed as Not Constructive by youtubemasterWOW and Ziffixture
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?