Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

[SOLVED] How do I make mobile buttons for phones and tablets?

Asked by 4 years ago
Edited 4 years ago

I solved this by using a tutorial. But thanks to the comments for helping!

2 answers

Log in to vote
1
Answered by
Aztralzz 169
4 years ago

Put a screengui in startergui, then put a textbutton. For the leaderstats, put this code into ServerScriptService:

01--leaderstats code
02local function onPlayerJoin(player)
03    local leaderstats = Instance.new("Folder")
04    leaderstats.Name = "nameyouwant"
05    leaderstats.Parent = player
06 
07    -- Display an 'IntValue' on leaderboard
08    local gold = Instance.new("IntValue")
09    gold.Name = "yourname"
10    gold.Value = 0
11    gold.Parent = leaderstats
12end
13 
14-- Run 'onPlayerJoin()' when the 'PlayerAdded' event fires
15game.Players.PlayerAdded:Connect(onPlayerJoin)
View all 29 lines...
0
BTW: I didn't test this out. Aztralzz 169 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
01while true do
02    wait()
03    if script.Parent.Activated then
04        local leaderboard = game.Players.LocalPlayer:FindFirstChild("leaderstats")
05        local respect = leaderboard:FindFirstChild("Respect")
06        respect.Value = respect.Value + 1
07        local audio = workspace:FindFirstChild("RESPECT THE VETS")
08        audio:Play()
09        script.Parent.BackgroundTransparency = 0.5
10        wait(1)
11        script.Parent.BackgroundTransparency = 0
12    end
13end

my script

Answer this question