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

When I added a script, the rest broke, can you fix it?

Asked by 4 years ago
Edited 4 years ago

Hi there! I'm making a game where the players points update by one every second. I need the points to start updating only when the player steps on a model, called "Game." Here is my script, which doesn't work. Can you fix it?

01local Players = game:GetService("Players")
02    local UpdatePoints = false
03    local function onTouch(part)
04        return end
05    end
06    part.Touched:Connect(onTouch)
07    Players.PlayerAdded:Connect(function(Player)  
08            Player.CharacterAdded:Connect(function(Character)
09                    UpdatePoints = true
10 
11                    local Leaderstats = Instance.new("Folder")
12                    Leaderstats.Name = "leaderstats"
13                    Leaderstats.Parent = Player
14 
15                    local Points = Instance.new("IntValue")
View all 35 lines...
0
I don't understand the return end part? thecelestialcube 123 — 4y

1 answer

Log in to vote
0
Answered by
TGazza 1336 Moderation Voter
4 years ago

On your Touched function you have an extra end, so

01local Players = game:GetService("Players")
02local UpdatePoints = false
03local function onTouch(part)
04    return end
05end
06 
07--should be
08local Players = game:GetService("Players")
09local UpdatePoints = false
10local function onTouch(part)
11    return
12end

The rest looks fine! :)

Ad

Answer this question