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

What do I need to fix for my Function script [UPDATED]?

Asked by
cboyce1 40
10 years ago
workspace.TryArea1.Touched:connect(function(Handle)
    if Handle.Name == "Handle" then
        print(Handle)
    end
end)

function onPrint (Handle)
    workspace.StarterGui.TRY.TryText.TextTransparency = 0
    wait (5)
    workspace.StarterGui.TRY.TryText.TextTransparency = 1
end

So I have a script which whenever a part named Handle touches it, it would print, 'Handle'. I want a GUI to pop up that says, "TRY!". How could I fix this?

1 answer

Log in to vote
0
Answered by 10 years ago
game.Workspace.TryArea1.Touched:connect(function(Handle) -- It's not workspace but game.Workspace
    if Handle.Name == "Handle" then
        print("Handle") -- You forgot the "". Use the "" if you want to use text
    end
end)

function onPrint (Handle)
    game.Workspace.StarterGui.TRY.TryText.TextTransparency = 0 -- You changed the ServerGui. This won't do anything. Change it in the Player. 
    wait (5)
    workspace.StarterGui.TRY.TryText.TextTransparency = 1 -- Same here
end

Ad

Answer this question