RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a click simulator with a gui."
-- local script for clicking button local button = script.Parent local player = game:GetService('Players').LocalPlayer local clicks = player.leaderstats.Clicks local function onClick() clicks.Value = clicks.Value + 1 end button.MouseButton1Click:Connect(onClick) -- server script for leaderstats game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new('Folder') leaderstats.Name = 'leaderstats' leaderstats.Parent = player local clicks = Instance.new('IntValue') clicks.Name = 'Clicks' clicks.Value = 0 clicks.Parent = leaderstats end) -- GUI setup -- Create a ScreenGui in StarterGui -- Add a TextButton inside the ScreenGui and name it "ClickButton" -- Add a TextBox inside the ScreenGui and name it "ClicksDisplay" -- Set the Text of the ClickButton to "Click me!" -- Set the Text of the ClicksDisplay to "Clicks: 0" -- local script for updating clicks display local player = game:GetService('Players').LocalPlayer local clicksDisplay = script.Parent.ClicksDisplay local clicks = player.leaderstats.Clicks local function updateDisplay() clicksDisplay.Text = 'Clicks: ' .. clicks.Value end clicks:GetPropertyChangedSignal('Value'):Connect(updateDisplay) updateDisplay()