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

How do I make a script do 2 things at once?

Asked by 10 years ago

I am trying to make a button Say "I've been clicked!" and Reset or kill the player. But I don't know what is wrong, I have asked numerous questions just to do this one thing.

My Code is here:

local player = game.Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Click Me To Reset!"
textButton.MouseButton1Down:connect(function()
textButton.Text = "I've been clicked!"
player.Character.Humanoid.health = 0
end)
0
The 'Health' property should be capitalized. Perci1 4988 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

Like perci1 said, health should be Health.

0
Is that all I need? iPrepared 30 — 10y
0
Ya. Don't forget to accept my answer! TroytheDestroyer 75 — 10y
0
Ok XD iPrepared 30 — 10y
0
thanks. TroytheDestroyer 75 — 10y
Ad

Answer this question