Taunt Not Changing

Im trying to make a shop were if you have enough wins you can change the taunt locally.

The problem Im having is that whenever I click the text button and fire the local script nothing happens not even the Id value in the animation. Another thing is that the script that firess the animation is also local and it gets the animation from replicated storage.

Let me know if you see any prominant errors that would make it not work.

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NPC = ReplicatedStorage.NPC

local function onButtonClick()
	local player = Players.LocalPlayer
	if player.leaderstats.Wins.Value >= 10 then
		ReplicatedStorage.DanceAnimation = "rbxassetid://7403887788"  
	end
end

script.Parent.MouseButton1Click:Connect(onButtonClick)

Screenshot 2023-04-24 092116

Screenshot 2023-04-24 092141

Localscripts don’t run in workspace, you should parent it to StarterPlayerScripts.

so like by using a remote event?

No, you can do something like:

local Button = workspace['Rounded Block'].SurfaceGui.Frame.ScrollingFrame.TextButton

Button.MouseButton1Click:Connect(onButtonClick)

You need to give the 3 TextButtons unique names though.

Ohhhhh thanks for clearing I think thats the what I had wrong, if not I will reply

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