Defining a tool In a Serversided script in a GUI

Hi, I’m trying to make it so the value (Your Score) will be displayed on your tool once you have finished the Homework (The Tool)

I’m completely stuck on this one, I don’t where to go (Since it’s suppose to SS), and I don’t think local script shows for other players. Can someone please help me out?

script.Parent.MouseButton1Click:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local Tool = character:FindFirstChild("Homework")
	script.Parent.Parent.Parent.Value.Value += 1
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.pointbuffer.Visible = true
	wait(2)
	script.Parent.Parent.Parent["victory.wav"]:Play()
	script.Parent.Parent.Parent.pointbuffer.Visible = false
	script.Parent.Parent.Parent.Results.Visible = true
	script.Parent.Parent.Parent["Paper Movement Cu Handling Grabs Flips Wavin (SFX)"]:Play()
	Tool.paper.NameTag.Display.Text = "This player has scored"..script.Parent.Parent.Parent.Value.Value.."points!"
	
	print(script.Parent.Parent.Parent.Value.Value)
end)

Here is the tool:

You can’t get user input from the server side (in most cases, there are exceptions to the rule). If script.Parent is a Tool, then you should use the Activated event instead, which would work on the Server side

1 Like

It’s misspelt :sob:

I would recommend to use Remote Events to communicate from a local script to a server. Also, use scripts in the tool instead of using MouseButton1Click since tools have tool.Activated which does the same thing as clicking the left mouse button.

1 Like