My Value Isn't Changing!

I set up a remote event to change the shape of the spinner as it’s thrown but the shape won’t update once the remote event is fired. Here’s the script down below.
Remote event for changing shape: Not the full script just the important piece

local data = player:WaitForChild("MatchData")
	local DMGM = data.DmgM
	local CoolReduction = data.CoolReduction
	local spinners = data.SpinnersLeft
	local espinners = data.ExtraSpinners
	local SSM = data.SpinnerSpeedMult
		
		local data = player:WaitForChild("DataSave")
		local color = data.Color
		local shape = data.Shape
		local material = data.Material
		local trail = data.Trail



		-- Update the spinner's properties based on the player's customization data
	local hum = player.Character.Humanoid
		if spinners.Value > 0 then 
			local newSpinner = spinnerTemplate:Clone()
			if color.Value == 0 then
				newSpinner.BrickColor = BrickColor.new("Bright red")
			elseif color.Value == 1 then
				newSpinner.BrickColor = BrickColor.new("Bright orange")
			elseif color.Value == 2 then
				newSpinner.BrickColor = BrickColor.new("Bright yellow")
			elseif color.Value == 3 then
				newSpinner.BrickColor = BrickColor.new("Bright green")
			elseif color.Value == 4 then
				newSpinner.BrickColor = BrickColor.new("Bright blue")
			elseif color.Value == 5 then
				newSpinner.BrickColor = BrickColor.new("Bright violet")
			elseif color.Value == 6 then
				newSpinner.BrickColor = BrickColor.new("White")
			elseif color.Value == 7 then
				newSpinner.BrickColor = BrickColor.new("Black")
			end

			if shape.Value == 0 then
				newSpinner.Shape = Enum.PartType.Cylinder
			elseif shape.Value == 1 then 
				newSpinner.Shape = Enum.PartType.Block
			end

Change Shape Value Remote Event

game.ReplicatedStorage.ChangeShapeEvent.OnServerEvent:Connect(function(plr, number)
	local ds = 	plr.DataSave
	local s = ds:WaitForChild("Shape")
	s.Value = number
end)

Remote Event Fired Script (In a text button)

local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.ChangeColorEvent:FireServer(1)
	game.Workspace.Sounds.EquipCust:Play()
end)

2 Likes

In your RemoteEvent in TextButton, you are firing the ChangeColorEvent instead of the ChangeShapeEvent

local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.ChangeShapeEvent:FireServer(1)
    game.Workspace.Sounds.EquipCust:Play()
end)
2 Likes

Whoops! Didn’t catch that. Let me see if it will work!

2 Likes

It happens almost always hahaha, there’s nothing to worry about :).

1 Like

It worked! Thanks for catching that mistake! Things like this just slip my mind sometimes. All part of developing a game :slight_smile:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.