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

Why is this not working? I thought I did everything right... (Edited)

Asked by 8 years ago

I'm trying to modify CloneTroopers Chat Script so it can show ranks on the side, so I thought I could take a bit of the code from ChatRecorder and merge it together but it does not want to work what am I doing wrong here?

I also have no errors right so ever...

The section I thought would work from ChatRecorder Modify it to show just ranks not the name of the group

groupid=782018

game.Players.ChildAdded:connect(function (child) 
local label=Instance.new("StringValue",child) label.Name="Rank"
if child:IsInGroup(groupid) then label.Value=child:GetRoleInGroup(groupid) 
else label.Value="Player" 
end
end)  -- Added an extra end but now it's not showing the chat....

And here's the section I'm trying to modify to add ranks too... No output for this... If I have to post the whole script it's about 250 lines of code...

function Chat:CreateMessage(cPlayer, message)       
    local pName = cPlayer ~= nil and cPlayer.Name or 'GAME' 
    message = message:gsub("^%s*(.-)%s*$", "%1")        
    self.MessageQueue[#self.MessageQueue] = (#self.MessageQueue > self.Configuration.HistoryLength) and nil or self.MessageQueue[#self.MessageQueue]
    local pLabel = self.Templates.pLabel:clone()
    pLabel.Name = pName;
    pLabel.Text = pName.Rank .. " " .. pName .. ":";
    pLabel.Parent = self.RenderFrame;           
    pLabel.TextColor3 = (cPlayer.Neutral) and Chat:ComputeChatColor(pName) or cPlayer.TeamColor.Color 
    local nString = self.CachedSpaceStrings_List[pName] or Chat:ComputeSpaceString(pLabel)
    local mLabel = self.Templates.mLabel:clone()
    mLabel.Name = pName .. ' - message';                    
    mLabel.TextColor3 = Chat.Configuration.MessageColor;                    
    mLabel.Text = nString .. message;
    mLabel.Parent = self.RenderFrame;   
    local heightField = mLabel.TextBounds.Y 
    mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0)   
    pLabel.Size = mLabel.Size
    local yPixels = self.RenderFrame.AbsoluteSize.Y
    local yFieldSize = mLabel.TextBounds.Y
    local queueField = {}   
    queueField['Player'] = pLabel 
    queueField['Message'] = mLabel 
    queueField['SpawnTime'] = tick()
    table.insert(self.MessageQueue, 1, queueField)      
    Chat:UpdateQueue(queueField)
end
0
your first script is missing an end! You need an end that'll look like this: end) THEN you need an end like this: end <-- go end first then end) under alphawolvess 1784 — 8y
0
Now the messages don't show up... and no errors... Anciteify 70 — 8y
0
This scripting model you claimed is a bit advanced to help. Merging codes may not be a good idea unless you can understand everyline alphawolvess 1784 — 8y

Answer this question