|
| 22 Jun 2014 12:02 PM |
no errors anywhere, but it doesn't work
--WHAT ITS SUPPOSED TO DO-- --[[ 1. when u click "Send msg" in the "Friends list" it should set or update async or w/e into the "inbox" for islandmaker2012(or w/e the text in the box is) and yes, the text is "islandmaker2012"
--Note: all variables are correct, so im not sure what im doing rong
when a player joins, it sees if inbox is empty, if its not, it creates a msg in their playergui with the text or unpack(inbox) ]]
--SEND SCRIPT--
send = script.Parent msg = send.Parent sendmsg = msg.Parent to = sendmsg.Parent p = script.Parent repeat p=p.Parent until p:IsA("Player") msgs = game:GetService("DataStoreService"):GetDataStore("Msgs") inbox = msgs:GetAsync(to.Text.."Msgs") or {} if inbox==nil or type(inbox~="table") then inbox = {} msgs:SetAsync(to.Text.."Msgs",inbox) end script.Parent.MouseButton1Click:connect(function() print("Sending msg:"..msg.Text.." To:"..to.Text) inbox[#inbox+1] = {from=p.Name,msg = msg.Text} msgs:SetAsync(to.Text.."Msgs",inbox) end)
--DISPLAY SCRIPT--
msgs = game:GetService("DataStoreService"):GetDataStore("Msgs") game.Players.PlayerAdded:connect(function(p) inbox = msgs:GetAsync(p.Name.."Msgs") if inbox~=nil and type(inbox) == "table" then m = Instance.new("Message",p:WaitForChild("PlayerGu")) m.Text = unpack(inbox) print(unpack(inbox)) game.Debris:AddItem(m,5) else msgs:SetAsync(p.Name.."Msgs",{}) end end) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:15 PM |
| I guess no one knows how to fix..? |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 22 Jun 2014 12:17 PM |
Any output?
I would appreciate it if you came to my place and donate some robux! Thanks! |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:18 PM |
| no output, no errors, im stumped :\ |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:19 PM |
| put prints between each line with the first line as 1, second as 2, etc, and see where it stops |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 22 Jun 2014 12:20 PM |
You probably messed up on the conditions, most likely.
OHH waitt, I found it (not being sarcastic, I found it as I was typing .-.)
" m = Instance.new("Message",p:WaitForChild("PlayerGu")) -- PlayerGu? --> PlayerGui
I would appreciate it if you came to my place and donate some robux! Thanks! |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:21 PM |
FKKKKKKKKKKKKKKKKKKKKKKKKKK
tyvm |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:22 PM |
ok, now theres an error..
line 6, string expected
.-. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:24 PM |
m.Text = unpack(inbox)
what |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:25 PM |
type(inbox) = "table"
k?
print(unpack({"Hi","Hello"}))
Hi Hello
.-. |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 22 Jun 2014 12:25 PM |
It's a function that's called...
I would appreciate it if you came to my place and donate some robux! Thanks! |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:26 PM |
I added "".. and ..""
to it but now it says:
Workspace.Script:6 attempt to concatenate a nil value.. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:28 PM |
Its because if inbox is empty, you will be trying to have something's text be nothing which isnt a string. If you try to concatenate to nothing, it will error.
|
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:29 PM |
"".. and ..""
Also because youre using a term/variable that was never defined. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:31 PM |
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#unpack
unpack isn't undefined..
anyway
then should I add into the if statement..?
and #inbox~=0 then? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2014 12:37 PM |
now, it says this
Workspace.Script:6: attempt to concatenate a table value
WTF ROBLOX |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 12:38 PM |
msgs = game:GetService("DataStoreService"):GetDataStore("Msgs") game.Players.PlayerAdded:connect(function(p) inbox = msgs:GetAsync(p.Name.."Msgs") if inbox~=nil and type(inbox) == "table" and #inbox~=0 then m = Instance.new("Message",p:WaitForChild("PlayerGui")) m.Text = ""..unpack(inbox)..""--line 6 print(""..unpack(inbox).."") game.Debris:AddItem(m,5) elseif inbox==nil or type(inbox)~="table" then msgs:SetAsync(p.Name.."Msgs",{}) end end) |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 01:25 PM |
BUMP
I still haven't figured this out q.q |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2014 02:10 PM |
| wait does this show messages ingame? e.e |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2014 02:12 PM |
| ^supposed to, but it doesn't, it just errors randomly |
|
|
| Report Abuse |
|
|
| |
|