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

How to make click for points script but only when round is in session?

In my game I have rounds. What i want to happen is when someone dies they drop an item. I have already done that but I want them to drop it when the round is happening only. The infovalue is a gui at the top of the screen.

--Made by 1Messi3903
plr = game.Players.LocalPlayer
status = game.ReplicatedStorage.InfoValue.Value

script.Parent.MouseClick:connect(function()
i = 120, 0, -1
	if status = i..' seconds remaining!' then
	plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 5
	wait()
	script.Parent.Parent:Destroy()
	
end)

5 comments

0

I see there is an error in line 6. Look: when you want to determinate a value of a variable,you need to use 1 equal (=),but when you want to check for true or false, you need to use 2 equals (==). The 6th line should be like this:

0

if status==i..'seconds remaining!' then

0

I see there is an error in line 6. Look: when you want to determinate a value of a variable,you need to use 1 equal (=),but when you want to check for true or false, you need to use 2 equals (==). The 6th line should be like this:

0

I don't understand what the "i = 120, 0, -1" part is for. It looks like a for loop, but it is not cuz it does not have the word for and do and a end to close it. I'm confused.

0

It is a timer. It goes from 120 seconds down to 0 and when it hits 0 the round ends

1 answer

Here is the fixed script By the way, this is a local script

--Made by 1Messi3903
plr = game.Players.LocalPlayer
status = game.ReplicatedStorage.InfoValue.Value

script.Parent.MouseClick:connect(function()
for i = 120, 0, -1 do
    if status == i..' seconds remaining!' then
    	plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 5
    	wait()
    	script.Parent.Parent:Destroy()
	end
	wait(1)
end)

1 comment

0

Read my bio. Ok? How hard is this?

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