Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Expected identifier when parsing expression, got ‘local’?

			if not Player.Character:FindFirstChild("Curse") then
				local otherHuman = F.GetHuman(Args[3])
				if not otherHuman then return false end
				Debris:AddItem(
					local aabma = Instance.new("ObjectValue") -- the local here is the error
					Parent = Player.Character
					Name = "Curse"
					Value = otherHuman
					
					Stats.Duration
				)

I'd want to know why my code is creating an error. And if there isn't a method for it to be fixed then how could I change the properties of an instance through a script without calling it a name, a name meaning for ex : local inst = Instance.new("Frame")

2 comments

0

Is there an end at the bottom?

0

Yes

1 answer

✓ Accepted answer

I do not think you can create a new object in debris but here is what you can do

if not Player.Character:FindFirstChild("Curse") then
    local otherHuman = F.GetHuman(Args[3])
    if not otherHuman then return false end

        local aabma = Instance.new("ObjectValue") -- the local here is the error
        Parent = Player.Character
        Name = "Curse"
        Value = otherHuman
game:GetService('Debris'):AddItem(aabma, Stats.Duration.Value)

2 comments

0

Thank you for the extremely fast answer

0

np!

This discussion is preserved as it was. New answers, comments, and votes are closed.