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

No Events And Functions Are Working When Fired Regarding A GUI?

Asked by 2 years ago

So you can teleport somewhere in the same game (used a CFrame) and then there's a leave button, the problem is, when you press leave you're still sitting (you teleport into a seat for the first teleportation) and I've tried to get the character to unsit in this post: https://scriptinghelpers.org/questions/126022/how-do-you-set-a-players-sit-property-to-false-with-a-script

Not working, I even try to kill them like in this:

local BackToSpawnA = game.Workspace.GameSpace.BackToSpawnA

BackToSpawnA.Touched:Connect(function(Kill)
    if Kill and Kill.Parent:FindFirstChild("Humanoid") then
        Kill.Parent.Humanoid.Health = 0
    end
end)

It just doesn't work, it seems like the events are separated from the GUI somehow and don't fire, or the thing just isn't touching Humanoid (it probably is though)

Leaving GUI code:

LeaveButton.MouseButton1Click:Connect(function(Leaving)
    local BackToSpawn = CFrame.new(game.Workspace.GameSpace.BackToSpawnA.Position)
    HRP.CFrame = BackToSpawn
end)

1 answer

Log in to vote
0
Answered by 2 years ago

fixed it

Ad

Answer this question