This won't save, I can make it so the players name prints, but I don't know how to make that printed name go into the text on the gui (A in game purchase logging gui)
Note: Other people have to see it! not developer console (Unless you can make it work)!
I have no idea where to start, this is all I have so far.. And there are no tutorials online
script.Parent.Touched:connect(function(part) if part.Parent:FindFirstChild("Humanoid") then print("Purchased (Pistol 375$) "..part.Parent.Name) end end) wait (1)
^ ^ That prints it into the developer console, but Only I can see it, I want people with the GUI to be able to see it, considering you can't give perms for that.
Put this in your server script when the item is touched and purchased. You may want to fire a separate event of course for the actual purchase - I'd do a server function for that.
local AnnoucementEvent = Instance.new("RemoteEvent",game.ReplicatedStorage) AnnoucementEvent.Name="GameToClientGuiEvent" local istouched=false script.Parent.Touched:connect(function(part) if istouched==false then istouched=true if part.Parent:FindFirstChild("Humanoid") then print("firing the annoucement event") local player = game.Players:GetPlayerFromCharacter(part.Parent) local message = player.Name.." bought the item!!!!" AnnoucementEvent:FireAllClients(message) end wait(3) local message = "" AnnoucementEvent:FireAllClients(message) istouched=false end end)
Then in a localscript under StarterPlayerScripts (I named mine PlayerAnnoucements)
local AnnoucementEvent = game.ReplicatedStorage:WaitForChild("GameToClientGuiEvent",10) local Player = game.Players.LocalPlayer local GUI = Player.PlayerGui local AnnoucementScreenGui = Instance.new("ScreenGui") AnnoucementScreenGui.Name = "AnnoucementScreenGui" AnnoucementScreenGui.Parent = GUI local AnnounementFrame = Instance.new("Frame") AnnounementFrame.Name = "AnnounementFrame" AnnounementFrame.Position = UDim2.new(1,-500,0,0) AnnounementFrame.Size = UDim2.new(0,500,0,50) AnnounementFrame.BackgroundTransparency = .5 AnnounementFrame.Parent = AnnoucementScreenGui local AnnoucementText = Instance.new("TextLabel",AnnounementFrame) AnnoucementText.Size = UDim2.new(1,0,1,0) AnnoucementText.TextSize = 32 AnnoucementText.TextScaled = true AnnoucementText.BackgroundTransparency = .5 AnnoucementText.Text = "" function UpdateAnnouncementScreenGui(str) AnnoucementText.Text = str end AnnoucementEvent.OnClientEvent:connect(UpdateAnnouncementScreenGui)
There's plenty of room for improvement.. you may want to append the message....
I would have the AnnoucementFrame and Text elements already preset under StarterGui and so all the script has to do is set the Text value.. but I'll leave the rest to you to figure out... Let me know if you need more help.