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

Insert a number to close a function?

Asked by 5 years ago

Hi guys, i have this code

01local sound = Instance.new("Sound", game.Workspace)
02sound.SoundId = "rbxassetid://3625290171"
03 
04local player = game:GetService("Players").LocalPlayer
05local ShowMessage = player.Backpack:WaitForChild("ShowMessage")
06MESSAGE_DELAY = 3.5
07 
08function dmt(hit)
09if hit.Parent ~= nil then
10local player = game.Players:playerFromCharacter(hit.Parent)
11    if player ~= nil then
12        if player.leaderstats.PhereStage.Value == script.Parent.Name - 1 then
13        local h = hit.Parent:FindFirstChild("Humanoid")
14            if h ~= nil then
15                if h.Health ~= 0 then
View all 25 lines...

I think the problem is at the end

1workspace.StartPhere.1.Touched:connect(dmt)

I have 0 errors in console, but 1 error inside the script:

1Expected '=' when parsing assignment, got '.1.Touched'

i NEED call this Model "1", i can't change it. How i can fix?

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Change line 25 to:

1workspace.StartPhere['1'].Touched:connect(dmt)

That should fix it.

Ad

Answer this question