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

Expected identifier, got ____?

Asked by 5 years ago
Edited 5 years ago
function onTouched()


    local model1 = game.ServerStorage."DeadArnold"
local model2 = workspace."Arnold"
model1.Parent = workspace."Arnold"
model2:Destroy()
end

in this case, it got DeadArnold. The script is supposed to remove "Arnold" and replace it with DeadArnold.

0
In Lua, .something is the same as ["something"]. You're putting a string after the . and not text. User#25115 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

What Phlegethon said

local function onTouched()
    local model1 = game.ServerStorage.DeadArnold
    local model2 = workspace.Arnold
    model1.Parent = workspace.Arnold
    model2:Destroy()
end
Ad

Answer this question