I was recently working on a BanSystem, and it works. except for the fact that I wanted local logging with it (basically a new textlabel pops up everytime you ban / kick someone). And I created the code. However it doesn’t work and doesn’t throw any errors in the output.
Script:
local victim = script.Parent.Parent.Victim
local reason = victim.Parent.Reason
local typer = victim.Parent.Type
local template = script.Parent.template
local plr = game.Players.LocalPlayer
local name = plr.Name
local count = 0
victim.Changed:Connect(function()
count += 1
print("Cool")
local newlog = template:Clone()
newlog.Name = "Log"..count
newlog.Text = name..": "..typer.Value.." | "..victim.Value
newlog.Visible = true
end)
just a disclaimer: the “Cool” statement does print.
local victim = script.Parent.Parent.Victim
local reason = victim.Parent.Reason
local typer = victim.Parent.Type
local template = script.Parent.template
local plr = game.Players.LocalPlayer
local name = plr.Name
local count = 0
victim.Changed:Connect(function()
count += 1
print("Cool")
local newlog = template:Clone()
newlog.Parent = script.Parent -- Or wherever else the frame that holds it is.
newlog.Name = "Log"..count
newlog.Text = name..": "..typer.Value.." | "..victim.Value
newlog.Visible = true
end)
You should be assigning the parent property last, not directly after the instance is cloned.
local newlog = template:Clone()
newlog.Name = "Log"..count
newlog.Text = name..": "..typer.Value.." | "..victim.Value
newlog.Visible = true
newlog.Parent = script.Parent -- Or wherever else the frame that holds it is.