of     1   

frogfriend99
#228272342Thursday, November 30, 2017 10:00 PM GMT

Background: The player is supposed to grab a "key" from the janitor's office, but the "key" is just a transparent brick with a key mesh inside (irrelevant.) Anyway, when the player touches the transparent brick, it's supposed to change the Gui to the new objective, and remove the back door giving the player the option to escape. This is what I have for the script inside the transparent brick: local function onTouch() wait(0.01) game.Workspace.BackDoor:Destroy() game.Players.LocalPlayer.PlayerGui.Help.TextLabel.Text = "Objective: Find a way out" script.Parent:Destroy() game.Workspace.KeyModel:Destroy() end script.Parent.Touched:connect(onTouch) I've tried replacing the script with a LocalScript, but that doesn't seem to be working either. Any help will be greatly appreciated. I've been stumped on this for the past day.
frogfriend99
#228272746Thursday, November 30, 2017 10:12 PM GMT

bump
frogfriend99
#228273628Thursday, November 30, 2017 10:41 PM GMT

bump x2
sjr04
#228273747Thursday, November 30, 2017 10:45 PM GMT

game:Destroy()
frogfriend99
#228275455Thursday, November 30, 2017 11:44 PM GMT

bump x3
TheEpicScriptCreator
#228275501Thursday, November 30, 2017 11:46 PM GMT

same here );
frogfriend99
#228276811Friday, December 01, 2017 12:28 AM GMT

bump x4
shaquandean23
#228278446Friday, December 01, 2017 1:22 AM GMT

Personally depending on where the key is, i wouldn't use onTouch ( i.e, on a desk, etc) so if you don't mind imma rescript this. Insert a click detector inside the Key, and we will script the key instead. local function OnClick(player) wait(0.01) local Backdoor = game.Workspace.Backdoor local Key = game.Workspace.KeyModel Backdoor.CanCollide = false Backdoor.Transparency = 1 player.PlayerGui.Help.TextLabel.Text = "Objective: Find a way out." Key.Parent = game.ServerStorage script.Parent.ClickDetector:connect(OnClick) -> This script will make the back door invisible and allow players to walk thru it, allowing you to not have to replace it in an actual game. And when the player clicks the key,instead of deleting the key, it sends it to server storage ( which makes it invisible by definition from the player) and updates the players gui.
DonaldTrumblox
#228280392Friday, December 01, 2017 2:22 AM GMT

I would use a remote event if the game is FE here is how I would make it: Invisible Script(Server): local event = game:GetService(“ReplicatedStorage”):WaitForChild(“ChangeObjective”) local parent = script.Parent local text = “Objective: Find a way out” local function onTouch(part) if game.Players:GetPlayerFromCharacter(part.Parent) then local player = game.Players:GetPlayerFromCharacter(part.Parent) wait(0.01) game.Workspace.BackDoor:Destroy() event:FireClient(player,text) script.Parent:Destroy() game.Workspace.KeyModel:Destroy() end end script.Parent.Touched:connect(onTouch) Client: local player = game.Players.LocalPlayer local event = game:GetService(“ReplicatedStorage”):WaitForChild(“ChangeObjective”) local function ChangeObjective(text) player.PlayerGui.Help.TextLabel.Text = text end event.OnClientEvent:Connect(ChangeObjective(text))
frogfriend99
#228283314Friday, December 01, 2017 3:57 AM GMT

@shaquandean23 I did that, but it's still not working.
frogfriend99
#228342846Saturday, December 02, 2017 8:13 PM GMT

bump bump bump
EternalScythe
#228344597Saturday, December 02, 2017 8:51 PM GMT

Hehe. Put this in the start of the script: repeat wait() until game.Players.LocalPlayer~=nil repeat wait() until game.Players.LocalPlayer.Character~=nil Now it should work :V

    of     1