well, I wanted it to be when you collect a "star" the box would say A STAR?! here is the script
local brick = script.Parent function onTouched(hit) for i,player in ipairs(game.Players:GetPlayers()) do if player.Character then local stat = player:FindFirstChild("leaderstats") if stat then game.SoundService.Sound:Play() player.leaderstats.Bonuses.Value = player.leaderstats.Bonuses.Value +1 player.leaderstats.TotalBonuses.Value = player.leaderstats.TotalBonuses.Value +1 game.StarterGui.textbox.text = ("A STAR?!") --the problem is that when i was typing textbox i could not use TAB to finish the word textbox thing. same with text brick:Destroy() end end end end brick.Touched:connect(onTouched)
What you need to do is put ScreenGui in the StarterGui and put the TextBox in it.
local remote = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage")) remote.Name = "Star" script.Parent.Touched:connect(function(part) local player = game.Players:GetPlayerFromCharacter(part.Parent) if player then player.leaderstats.Bonuses.Value = player.leaderstats.Bonuses.Value + 1 player.leaderstats.TotalBonuses.Value = player.leaderstats.TotalBonuses.Value + 1 local sound = game.SoundService.Sound:Clone() sound.Parent = player.PlayerGui sound.Playing = true player.PlayerGui.ScreenGui.textbox.Text = text brick:Remove() end end)