-
What do you want to achieve? Keep it simple and clear!
-I want players in my game to be able to choose 1 out of 3 cards in a popup deck when it shows up (Roguelike kinda) and they can use that card as an ability. -
What is the issue? Include screenshots / videos if possible!
-Whenever 2 or more people choose the same card, if one uses the ability, it also activates to the other person with the same card.
Local Script:
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
script.Parent.Parent.Parent.Parent.Enabled = false
game:GetService("ReplicatedStorage").Remotes.CardPick:FireServer(script.Parent)
end)
Server Script:
local uis = game:GetService("UserInputService")
local replicated = game:GetService("ReplicatedStorage")
local tweenservice = game:GetService("TweenService")
game:GetService("ReplicatedStorage").Remotes.CardPick.OnServerEvent:Connect(function(player : Player, card : TextButton)
local spawnedcards = player.PlayerCardSpawn
local character = player.Character or player:WaitForChild("Character")
local humanoid = character:FindFirstChild("Humanoid")
local humanoidrootpart = character:FindFirstChild("HumanoidRootPart")
game:GetService("ReplicatedStorage").Remotes.CardActivated.OnServerEvent:Connect(function()
if abilityname.Value == "QuickFeet" and humanoid.Health > 0 then
print(card.Name .. " ability activated")
local startsound = replicated.Sounds.SpeedBoostStart:Clone()
local endsound = replicated.Sounds.SpeedBoostEnd:Clone()
startsound.Parent = character:FindFirstChild("HumanoidRootPart")
endsound.Parent = character:FindFirstChild("HumanoidRootPart")
humanoid.WalkSpeed += 13
end
end)
end)